mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 20:17:45 +00:00
sort: dedup using compare_by (#2064)
compare_by is the function used for sorting, we should use it for dedup as well.
This commit is contained in:
parent
49c9d8c901
commit
69f4410a8a
8 changed files with 28 additions and 71 deletions
|
@ -223,6 +223,16 @@ fn test_mixed_floats_ints_chars_numeric_unique() {
|
|||
test_helper("mixed_floats_ints_chars_numeric_unique", "-nu");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_words_unique() {
|
||||
test_helper("words_unique", "-u");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_numeric_unique() {
|
||||
test_helper("numeric_unique", "-nu");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mixed_floats_ints_chars_numeric_reverse() {
|
||||
test_helper("mixed_floats_ints_chars_numeric_unique_reverse", "-nur");
|
||||
|
|
2
tests/fixtures/sort/numeric_unique.expected
vendored
Normal file
2
tests/fixtures/sort/numeric_unique.expected
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
-10 bb
|
||||
aa
|
3
tests/fixtures/sort/numeric_unique.txt
vendored
Normal file
3
tests/fixtures/sort/numeric_unique.txt
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
aa
|
||||
-10 bb
|
||||
-10 aa
|
3
tests/fixtures/sort/words_unique.expected
vendored
Normal file
3
tests/fixtures/sort/words_unique.expected
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
aaa
|
||||
bbb
|
||||
zzz
|
4
tests/fixtures/sort/words_unique.txt
vendored
Normal file
4
tests/fixtures/sort/words_unique.txt
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
zzz
|
||||
aaa
|
||||
bbb
|
||||
bbb
|
Loading…
Add table
Add a link
Reference in a new issue