mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
sort: support multiple input files
This commit is contained in:
parent
87455f998a
commit
3bc5a5f769
5 changed files with 48 additions and 20 deletions
9
tests/fixtures/sort/multiple_files.expected
vendored
Normal file
9
tests/fixtures/sort/multiple_files.expected
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
4
tests/fixtures/sort/multiple_files1.txt
vendored
Normal file
4
tests/fixtures/sort/multiple_files1.txt
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
3
|
||||
7
|
||||
2
|
||||
5
|
5
tests/fixtures/sort/multiple_files2.txt
vendored
Normal file
5
tests/fixtures/sort/multiple_files2.txt
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
4
|
||||
8
|
||||
1
|
||||
9
|
||||
6
|
|
@ -52,6 +52,16 @@ fn test_version() {
|
|||
test_helper("version", "-V");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multiple_files() {
|
||||
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||
ucmd.arg("-n");
|
||||
ucmd.arg("multiple_files1.txt");
|
||||
ucmd.arg("multiple_files2.txt");
|
||||
let out = ucmd.run().stdout;
|
||||
assert_eq!(out, at.read("multiple_files.expected"));
|
||||
}
|
||||
|
||||
fn test_helper(file_name: &str, args: &str) {
|
||||
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||
ucmd.arg(args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue