mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
sort: add test for sorting a file which triggers a buffer resize
This commit is contained in:
parent
72b70a9387
commit
3651d73a40
6 changed files with 15 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
1
tests/fixtures/sort/start_buffer_a.txt
vendored
Normal file
1
tests/fixtures/sort/start_buffer_a.txt
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
aaa
|
||||
2
tests/fixtures/sort/start_buffer_b.expected
vendored
Normal file
2
tests/fixtures/sort/start_buffer_b.expected
vendored
Normal file
File diff suppressed because one or more lines are too long
4
tests/fixtures/sort/start_buffer_b.expected.debug
vendored
Normal file
4
tests/fixtures/sort/start_buffer_b.expected.debug
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/sort/start_buffer_b.txt
vendored
Normal file
1
tests/fixtures/sort/start_buffer_b.txt
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue