mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-17 04:06:18 +00:00
sort: improve tests
This commit is contained in:
parent
3d23ace9b8
commit
af47c66a00
2 changed files with 33 additions and 2 deletions
|
@ -771,6 +771,7 @@ fn test_check() {
|
|||
new_ucmd!()
|
||||
.arg(diagnose_arg)
|
||||
.arg("check_fail.txt")
|
||||
.arg("--buffer-size=10b")
|
||||
.fails()
|
||||
.stderr_only("sort: check_fail.txt:6: disorder: 5\n");
|
||||
|
||||
|
@ -892,6 +893,29 @@ fn test_compress() {
|
|||
.stdout_only_fixture("ext_sort.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn test_compress_merge() {
|
||||
new_ucmd!()
|
||||
.args(&[
|
||||
"--compress-program",
|
||||
"gzip",
|
||||
"-S",
|
||||
"10",
|
||||
"--batch-size=2",
|
||||
"-m",
|
||||
"--unique",
|
||||
"merge_ints_interleaved_1.txt",
|
||||
"merge_ints_interleaved_2.txt",
|
||||
"merge_ints_interleaved_3.txt",
|
||||
"merge_ints_interleaved_3.txt",
|
||||
"merge_ints_interleaved_2.txt",
|
||||
"merge_ints_interleaved_1.txt",
|
||||
])
|
||||
.succeeds()
|
||||
.stdout_only_fixture("merge_ints_interleaved.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_compress_fail() {
|
||||
TestScenario::new(util_name!())
|
||||
|
@ -1027,7 +1051,8 @@ fn test_output_is_input() {
|
|||
let (at, mut cmd) = at_and_ucmd!();
|
||||
at.touch("file");
|
||||
at.append("file", input);
|
||||
cmd.args(&["-m", "-o", "file", "file"]).succeeds();
|
||||
cmd.args(&["-m", "-u", "-o", "file", "file", "file", "file"])
|
||||
.succeeds();
|
||||
assert_eq!(at.read("file"), input);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue