1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

tr: generate an error for real if the input is a directory

This commit is contained in:
Sylvestre Ledru 2024-12-02 22:11:45 +01:00
parent 8a481ccf1c
commit 3e4221a461
4 changed files with 45 additions and 4 deletions

View file

@ -20,6 +20,14 @@ fn test_invalid_input() {
.fails()
.code_is(1)
.stderr_contains("tr: extra operand '<'");
#[cfg(unix)]
new_ucmd!()
.args(&["1", "1"])
// will test "tr 1 1 < ."
.set_stdin(std::process::Stdio::from(std::fs::File::open(".").unwrap()))
.fails()
.code_is(1)
.stderr_contains("tr: read error: Is a directory");
}
#[test]