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

expand: add support for "--tabs" shortcuts

Fixes #3575
This commit is contained in:
Daniel Hofstetter 2022-06-10 08:52:59 +02:00
parent 95de5f6494
commit e3cac647f6
2 changed files with 74 additions and 3 deletions

View file

@ -263,3 +263,33 @@ fn test_tabs_with_too_large_size() {
new_ucmd!().arg(arg).fails().stderr_contains(expected_error);
}
#[test]
fn test_tabs_shortcut() {
new_ucmd!()
.args(&["-2", "-5", "-7"])
.pipe_in("\ta\tb\tc")
.succeeds()
// 01234567890
.stdout_is(" a b c");
}
#[test]
fn test_comma_separated_tabs_shortcut() {
new_ucmd!()
.args(&["-2,5", "-7"])
.pipe_in("\ta\tb\tc")
.succeeds()
// 01234567890
.stdout_is(" a b c");
}
#[test]
fn test_tabs_and_tabs_shortcut_mixed() {
new_ucmd!()
.args(&["-2", "--tabs=5", "-7"])
.pipe_in("\ta\tb\tc")
.succeeds()
// 01234567890
.stdout_is(" a b c");
}