sort: generate test_start_buffer fixtures programmatically

This commit is contained in:
Jacob Greenfield
2025-09-26 18:08:36 -04:00
committed by Sylvestre Ledru
parent 3651d73a40
commit 25e269cbf8
5 changed files with 16 additions and 9 deletions
+16 -1
View File
@@ -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
View File
@@ -1 +0,0 @@
aaa
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long