1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #1993 from cbjadwani/master

uniq: Implement --group option
This commit is contained in:
Sylvestre Ledru 2021-04-05 22:33:04 +02:00 committed by GitHub
commit f57eb0fdfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 249 additions and 20 deletions

View file

@ -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");
}