mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #2151 from jfinkels/2141-translate-and-squeeze
tr: implement translate and squeeze (-s) mode
This commit is contained in:
commit
7e07438b38
2 changed files with 66 additions and 3 deletions
|
@ -77,6 +77,24 @@ fn test_squeeze_complement() {
|
|||
.stdout_is("aaBcDcc");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_translate_and_squeeze() {
|
||||
new_ucmd!()
|
||||
.args(&["-s", "x", "y"])
|
||||
.pipe_in("xx")
|
||||
.run()
|
||||
.stdout_is("y");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_translate_and_squeeze_multiple_lines() {
|
||||
new_ucmd!()
|
||||
.args(&["-s", "x", "y"])
|
||||
.pipe_in("xxaax\nxaaxx")
|
||||
.run()
|
||||
.stdout_is("yaay\nyaay");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delete_and_squeeze() {
|
||||
new_ucmd!()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue