mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
unexpand: implement "tabs" shortcuts
This commit is contained in:
parent
fa51f8b986
commit
edf4fee48f
2 changed files with 88 additions and 4 deletions
|
@ -156,6 +156,41 @@ fn unexpand_read_from_two_file() {
|
|||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tabs_shortcut() {
|
||||
new_ucmd!()
|
||||
.arg("-3")
|
||||
.pipe_in(" a b")
|
||||
.run()
|
||||
.stdout_is("\ta b");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tabs_shortcut_combined_with_all_arg() {
|
||||
fn run_cmd(all_arg: &str) {
|
||||
new_ucmd!()
|
||||
.args(&[all_arg, "-3"])
|
||||
.pipe_in("a b c")
|
||||
.run()
|
||||
.stdout_is("a\tb\tc");
|
||||
}
|
||||
|
||||
let all_args = vec!["-a", "--all"];
|
||||
|
||||
for arg in all_args {
|
||||
run_cmd(arg);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_comma_separated_tabs_shortcut() {
|
||||
new_ucmd!()
|
||||
.args(&["-a", "-3,9"])
|
||||
.pipe_in("a b c")
|
||||
.run()
|
||||
.stdout_is("a\tb\tc");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tabs_cannot_be_zero() {
|
||||
new_ucmd!()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue