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

fix tr with delete flag if more than 1 operand given (#5945)

* fix tr

* fix

* adding a test

* tr: rename test function

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
BaherSalama 2024-02-06 17:42:08 +02:00 committed by GitHub
parent 4c187e29d4
commit 5c2ae5be4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View file

@ -1147,3 +1147,15 @@ fn check_against_gnu_tr_tests_no_abort_1() {
.succeeds()
.stdout_is("abb");
}
#[test]
fn test_delete_flag_takes_only_one_operand() {
// gnu tr -d fails with more than 1 argument
new_ucmd!()
.args(&["-d", "a", "p"])
.pipe_in("abc")
.fails()
.stderr_contains(
"extra operand 'p'\nOnly one string may be given when deleting without squeezing repeats.",
);
}