Merge pull request #2397 from miDeb/sort/args

sort: refactor command line arguments
This commit is contained in:
Terts Diepraam
2021-06-14 12:49:19 +02:00
committed by GitHub
2 changed files with 206 additions and 156 deletions
+186 -140
View File
File diff suppressed because it is too large Load Diff
+20 -16
View File
@@ -762,26 +762,30 @@ fn test_pipe() {
#[test]
fn test_check() {
new_ucmd!()
.arg("-c")
.arg("check_fail.txt")
.fails()
.stdout_is("sort: check_fail.txt:6: disorder: 5\n");
for diagnose_arg in &["-c", "--check", "--check=diagnose-first"] {
new_ucmd!()
.arg(diagnose_arg)
.arg("check_fail.txt")
.fails()
.stdout_is("sort: check_fail.txt:6: disorder: 5\n");
new_ucmd!()
.arg("-c")
.arg("multiple_files.expected")
.succeeds()
.stdout_is("");
new_ucmd!()
.arg(diagnose_arg)
.arg("multiple_files.expected")
.succeeds()
.stdout_is("");
}
}
#[test]
fn test_check_silent() {
new_ucmd!()
.arg("-C")
.arg("check_fail.txt")
.fails()
.stdout_is("");
for silent_arg in &["-C", "--check=silent", "--check=quiet"] {
new_ucmd!()
.arg(silent_arg)
.arg("check_fail.txt")
.fails()
.stdout_is("");
}
}
#[test]
@@ -835,7 +839,7 @@ fn test_nonexistent_file() {
#[test]
fn test_blanks() {
test_helper("blanks", &["-b", "--ignore-blanks"]);
test_helper("blanks", &["-b", "--ignore-leading-blanks"]);
}
#[test]