mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 19:36:16 +00:00
Merge pull request #4232 from TechHara/whitespace
cut: add whitespace option for separating fields
This commit is contained in:
commit
36f3507bed
5 changed files with 310 additions and 45 deletions
|
@ -81,6 +81,38 @@ fn test_field_sequence() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_whitespace_delimited() {
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-f", COMPLEX_SEQUENCE.sequence, INPUT])
|
||||
.succeeds()
|
||||
.stdout_only_fixture("whitespace_delimited.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_whitespace_with_explicit_delimiter() {
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-f", COMPLEX_SEQUENCE.sequence, "-d:"])
|
||||
.fails()
|
||||
.code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_whitespace_with_byte() {
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-b", COMPLEX_SEQUENCE.sequence])
|
||||
.fails()
|
||||
.code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_whitespace_with_char() {
|
||||
new_ucmd!()
|
||||
.args(&["-c", COMPLEX_SEQUENCE.sequence, "-w"])
|
||||
.fails()
|
||||
.code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_specify_delimiter() {
|
||||
for param in ["-d", "--delimiter", "--del"] {
|
||||
|
|
5
tests/fixtures/cut/whitespace_delimited.expected
vendored
Normal file
5
tests/fixtures/cut/whitespace_delimited.expected
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
foo:bar:baz:qux:quux
|
||||
one:two:three:four:five:six:seven
|
||||
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
|
||||
the quick fox over the dog
|
||||
sally sells down the seashore are the seashells sally sells
|
Loading…
Add table
Add a link
Reference in a new issue