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

tr: generate an error if the input is a directory (#6855)

* tr: generate an error if the input is a directory

tested by tests/misc/read-errors

* tr: improve the test

* tr: take the commentinto account
This commit is contained in:
Sylvestre Ledru 2024-11-30 10:38:46 +01:00 committed by GitHub
parent 37fb0a02f8
commit 2ad3c45230
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 12 deletions

View file

@ -13,6 +13,15 @@ fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}
#[test]
fn test_invalid_input() {
new_ucmd!()
.args(&["1", "1", "<", "."])
.fails()
.code_is(1)
.stderr_contains("tr: extra operand '<'");
}
#[test]
fn test_to_upper() {
new_ucmd!()