sort: add test for sorting a file which triggers a buffer resize

This commit is contained in:
Jacob Greenfield 2025-09-25 20:31:05 -04:00 committed by Sylvestre Ledru
parent 72b70a9387
commit 3651d73a40
6 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,7 @@ use crate::{
};
use crate::{Line, print_sorted};
// Note: update `test_sort::test_start_buffer` if this size is changed
const START_BUFFER_SIZE: usize = 8_000;
/// Sort files by using auxiliary files for storing intermediate chunks (if needed), and output the result.

View file

@ -1906,4 +1906,10 @@ 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"]);
}
/* spell-checker: enable */

View file

@ -0,0 +1 @@
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