mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-17 04:06:18 +00:00
sort: validate input files at startup
This commit is contained in:
parent
a33b6d87b5
commit
1bb530eebb
2 changed files with 26 additions and 2 deletions
|
@ -979,10 +979,26 @@ fn test_verifies_out_file() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_verifies_out_file_after_keys() {
|
||||
fn test_verifies_files_after_keys() {
|
||||
new_ucmd!()
|
||||
.args(&["-o", "nonexistent_dir/nonexistent_file", "-k", "0"])
|
||||
.args(&[
|
||||
"-o",
|
||||
"nonexistent_dir/nonexistent_file",
|
||||
"-k",
|
||||
"0",
|
||||
"nonexistent_dir/input_file",
|
||||
])
|
||||
.fails()
|
||||
.status_code(2)
|
||||
.stderr_contains("failed to parse key");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn test_verifies_input_files() {
|
||||
new_ucmd!()
|
||||
.args(&["/dev/random", "nonexistent_file"])
|
||||
.fails()
|
||||
.status_code(2)
|
||||
.stderr_is("sort: cannot read: nonexistent_file: No such file or directory");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue