mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
tac: exit with proper code, move from getopts to clap, add test for invalid inputs (#1957)
This commit is contained in:
parent
751ae6a8f8
commit
e958864bd9
4 changed files with 95 additions and 67 deletions
|
@ -49,3 +49,21 @@ fn test_single_non_newline_separator_before() {
|
|||
.run()
|
||||
.stdout_is_fixture("delimited_primes_before.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_input() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
ucmd.arg("b")
|
||||
.run()
|
||||
.stderr
|
||||
.contains("tac: error: failed to open 'b' for reading");
|
||||
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
at.mkdir("a");
|
||||
ucmd.arg("a")
|
||||
.run()
|
||||
.stderr
|
||||
.contains("tac: error: failed to read 'a'");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue