mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
wc: Stricter simpler error handling
Errors are now always shown with the corresponding filename. Errors are no longer converted into warnings. Previously `wc < .` would cause a loop. Checking whether something is a directory is no longer done in advance. This removes race conditions and the edge case where stdin is a directory. The custom error type is removed because io::Error is now enough.
This commit is contained in:
parent
35793fc260
commit
657a04f706
5 changed files with 26 additions and 47 deletions
|
@ -212,7 +212,7 @@ fn test_read_from_directory_error() {
|
|||
new_ucmd!()
|
||||
.args(&["."])
|
||||
.fails()
|
||||
.stderr_contains(".: Is a directory\n")
|
||||
.stderr_contains(".: Is a directory")
|
||||
.stdout_is("0 0 0 .\n");
|
||||
}
|
||||
|
||||
|
@ -222,5 +222,5 @@ fn test_read_from_nonexistent_file() {
|
|||
new_ucmd!()
|
||||
.args(&["bogusfile"])
|
||||
.fails()
|
||||
.stderr_contains("bogusfile: No such file or directory\n");
|
||||
.stderr_contains("bogusfile: No such file or directory");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue