mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
tr: add squeeze option
This commit is contained in:
parent
b4d8265a07
commit
ac375d8b7d
2 changed files with 91 additions and 8 deletions
|
@ -32,3 +32,28 @@ fn test_delete_complement() {
|
|||
new_ucmd!()
|
||||
.args(&["-d", "-c", "a-z"]).pipe_in("aBcD").run().stdout_is("ac");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_squeeze() {
|
||||
new_ucmd!()
|
||||
.args(&["-s", "a-z"]).pipe_in("aaBBcDcc").run().stdout_is("aBBcDc");
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_squeeze_complement() {
|
||||
new_ucmd!()
|
||||
.args(&["-sc", "a-z"]).pipe_in("aaBBcDcc").run().stdout_is("aaBcDcc");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delete_and_squeeze() {
|
||||
new_ucmd!()
|
||||
.args(&["-ds", "a-z", "A-Z"]).pipe_in("abBcB").run().stdout_is("B");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delete_and_squeeze_complement() {
|
||||
new_ucmd!()
|
||||
.args(&["-dsc", "a-z", "A-Z"]).pipe_in("abBcB").run().stdout_is("abc");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue