1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

Merge pull request #3612 from cakebaker/ticket_3575

expand: add support for "--tabs" shortcuts
This commit is contained in:
Sylvestre Ledru 2022-06-16 13:18:38 +02:00 committed by GitHub
commit 9cfb92df3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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");
}