mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 20:17:45 +00:00
Merge pull request #1993 from cbjadwani/master
uniq: Implement --group option
This commit is contained in:
commit
f57eb0fdfa
8 changed files with 249 additions and 20 deletions
|
@ -147,3 +147,48 @@ fn test_invalid_utf8() {
|
|||
.failure()
|
||||
.stderr_only("uniq: error: invalid utf-8 sequence of 1 bytes from index 0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_group() {
|
||||
new_ucmd!()
|
||||
.args(&["--group"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("group.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_group_prepend() {
|
||||
new_ucmd!()
|
||||
.args(&["--group=prepend"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("group-prepend.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_group_append() {
|
||||
new_ucmd!()
|
||||
.args(&["--group=append"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("group-append.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_group_both() {
|
||||
new_ucmd!()
|
||||
.args(&["--group=both"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("group-both.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_group_separate() {
|
||||
new_ucmd!()
|
||||
.args(&["--group=separate"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("group.expected");
|
||||
}
|
||||
|
|
26
tests/fixtures/uniq/group-append.expected
vendored
Normal file
26
tests/fixtures/uniq/group-append.expected
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
aaaaa ⅰ
|
||||
|
||||
bbbbb ⅱ
|
||||
bbbbb ⅱ
|
||||
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
|
||||
eeeee ⅲ
|
||||
|
||||
fffff ⅲ
|
||||
fffff ⅲ
|
||||
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
|
||||
GGGGG ⅲ
|
||||
GGGGG ⅲ
|
||||
|
27
tests/fixtures/uniq/group-both.expected
vendored
Normal file
27
tests/fixtures/uniq/group-both.expected
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
aaaaa ⅰ
|
||||
|
||||
bbbbb ⅱ
|
||||
bbbbb ⅱ
|
||||
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
|
||||
eeeee ⅲ
|
||||
|
||||
fffff ⅲ
|
||||
fffff ⅲ
|
||||
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
|
||||
GGGGG ⅲ
|
||||
GGGGG ⅲ
|
||||
|
26
tests/fixtures/uniq/group-prepend.expected
vendored
Normal file
26
tests/fixtures/uniq/group-prepend.expected
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
aaaaa ⅰ
|
||||
|
||||
bbbbb ⅱ
|
||||
bbbbb ⅱ
|
||||
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
|
||||
eeeee ⅲ
|
||||
|
||||
fffff ⅲ
|
||||
fffff ⅲ
|
||||
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
|
||||
GGGGG ⅲ
|
||||
GGGGG ⅲ
|
25
tests/fixtures/uniq/group.expected
vendored
Normal file
25
tests/fixtures/uniq/group.expected
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
aaaaa ⅰ
|
||||
|
||||
bbbbb ⅱ
|
||||
bbbbb ⅱ
|
||||
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
ccccc ⅲ
|
||||
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
ddddd ⅲ
|
||||
|
||||
eeeee ⅲ
|
||||
|
||||
fffff ⅲ
|
||||
fffff ⅲ
|
||||
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
ggggg ⅲ
|
||||
|
||||
GGGGG ⅲ
|
||||
GGGGG ⅲ
|
Loading…
Add table
Add a link
Reference in a new issue