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

Merge pull request #6907 from sylvestre/tr2

tr: generate an error for real if the input is a directory
This commit is contained in:
Daniel Hofstetter 2024-12-04 10:20:08 +01:00 committed by GitHub
commit d878f6c774
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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]