mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
sort: generate test_start_buffer fixtures programmatically
This commit is contained in:
parent
3651d73a40
commit
25e269cbf8
5 changed files with 16 additions and 9 deletions
|
|
@ -1909,7 +1909,22 @@ fn test_color_environment_variables() {
|
|||
#[test]
|
||||
fn test_start_buffer() {
|
||||
// Test that a file with the exact same size as the start buffer is handled correctly
|
||||
test_helper("start_buffer_b", &["start_buffer_a.txt"]);
|
||||
const FILE_B: &[u8] = &[b'b'; 8_000];
|
||||
const FILE_A: &[u8] = b"aaa";
|
||||
|
||||
let mut expected = FILE_A.to_vec();
|
||||
expected.push(b'\n');
|
||||
expected.extend_from_slice(FILE_B);
|
||||
expected.push(b'\n');
|
||||
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
at.write_bytes("b", FILE_B);
|
||||
at.write_bytes("a", FILE_A);
|
||||
|
||||
ucmd.args(&["b", "a"])
|
||||
.succeeds()
|
||||
.stdout_only_bytes(&expected);
|
||||
}
|
||||
|
||||
/* spell-checker: enable */
|
||||
|
|
|
|||
1
tests/fixtures/sort/start_buffer_a.txt
vendored
1
tests/fixtures/sort/start_buffer_a.txt
vendored
|
|
@ -1 +0,0 @@
|
|||
aaa
|
||||
2
tests/fixtures/sort/start_buffer_b.expected
vendored
2
tests/fixtures/sort/start_buffer_b.expected
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
tests/fixtures/sort/start_buffer_b.txt
vendored
1
tests/fixtures/sort/start_buffer_b.txt
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue