mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008)
This commit is contained in:
parent
b26e12eaa4
commit
8474249e5f
35 changed files with 1442 additions and 213 deletions
12
tests/fixtures/sort/exponents-positive-general.expected
vendored
Normal file
12
tests/fixtures/sort/exponents-positive-general.expected
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
10E
|
||||
1000EDKLD
|
||||
10000K78
|
||||
+100000
|
||||
100E6
|
||||
50e10
|
12
tests/fixtures/sort/exponents-positive-general.txt
vendored
Normal file
12
tests/fixtures/sort/exponents-positive-general.txt
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
10000K78
|
||||
10E
|
||||
|
||||
|
||||
1000EDKLD
|
||||
|
||||
|
||||
100E6
|
||||
|
||||
50e10
|
||||
+100000
|
||||
|
12
tests/fixtures/sort/exponents-positive-numeric.expected
vendored
Normal file
12
tests/fixtures/sort/exponents-positive-numeric.expected
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+100000
|
||||
10E
|
||||
50e10
|
||||
100E6
|
||||
1000EDKLD
|
||||
10000K78
|
12
tests/fixtures/sort/exponents-positive-numeric.txt
vendored
Normal file
12
tests/fixtures/sort/exponents-positive-numeric.txt
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
10000K78
|
||||
10E
|
||||
|
||||
|
||||
1000EDKLD
|
||||
|
||||
|
||||
100E6
|
||||
|
||||
50e10
|
||||
+100000
|
||||
|
37
tests/fixtures/sort/human-mixed-inputs-reverse.expected
vendored
Normal file
37
tests/fixtures/sort/human-mixed-inputs-reverse.expected
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
.2T
|
||||
2G
|
||||
100M
|
||||
7800900K
|
||||
51887300-
|
||||
1890777
|
||||
56908-90078
|
||||
6780.0009866
|
||||
6780.000986
|
||||
789----009999 90-0 90-0
|
||||
1
|
||||
0001
|
||||
apr
|
||||
MAY
|
||||
JUNNNN
|
||||
JAN
|
||||
AUG
|
||||
APR
|
||||
0000000
|
||||
00
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-1.4
|
37
tests/fixtures/sort/human-mixed-inputs-reverse.txt
vendored
Normal file
37
tests/fixtures/sort/human-mixed-inputs-reverse.txt
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
JAN
|
||||
|
||||
0000000
|
||||
|
||||
00
|
||||
|
||||
0001
|
||||
|
||||
1
|
||||
|
||||
-1.4
|
||||
|
||||
JUNNNN
|
||||
AUG
|
||||
|
||||
apr
|
||||
|
||||
APR
|
||||
|
||||
|
||||
MAY
|
||||
1890777
|
||||
|
||||
56908-90078
|
||||
|
||||
51887300-
|
||||
|
||||
6780.0009866
|
||||
|
||||
789----009999 90-0 90-0
|
||||
|
||||
6780.000986
|
||||
|
||||
100M
|
||||
7800900K
|
||||
2G
|
||||
.2T
|
37
tests/fixtures/sort/human-mixed-inputs-stable.expected
vendored
Normal file
37
tests/fixtures/sort/human-mixed-inputs-stable.expected
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
-1.4
|
||||
JAN
|
||||
|
||||
0000000
|
||||
|
||||
00
|
||||
|
||||
|
||||
|
||||
|
||||
JUNNNN
|
||||
AUG
|
||||
|
||||
apr
|
||||
|
||||
APR
|
||||
|
||||
|
||||
MAY
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0001
|
||||
1
|
||||
789----009999 90-0 90-0
|
||||
6780.000986
|
||||
6780.0009866
|
||||
56908-90078
|
||||
1890777
|
||||
51887300-
|
||||
7800900K
|
||||
100M
|
||||
2G
|
||||
.2T
|
37
tests/fixtures/sort/human-mixed-inputs-stable.txt
vendored
Normal file
37
tests/fixtures/sort/human-mixed-inputs-stable.txt
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
JAN
|
||||
|
||||
0000000
|
||||
|
||||
00
|
||||
|
||||
0001
|
||||
|
||||
1
|
||||
|
||||
-1.4
|
||||
|
||||
JUNNNN
|
||||
AUG
|
||||
|
||||
apr
|
||||
|
||||
APR
|
||||
|
||||
|
||||
MAY
|
||||
1890777
|
||||
|
||||
56908-90078
|
||||
|
||||
51887300-
|
||||
|
||||
6780.0009866
|
||||
|
||||
789----009999 90-0 90-0
|
||||
|
||||
6780.000986
|
||||
|
||||
100M
|
||||
7800900K
|
||||
2G
|
||||
.2T
|
13
tests/fixtures/sort/human-mixed-inputs-unique.expected
vendored
Normal file
13
tests/fixtures/sort/human-mixed-inputs-unique.expected
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
-1.4
|
||||
JAN
|
||||
0001
|
||||
789----009999 90-0 90-0
|
||||
6780.000986
|
||||
6780.0009866
|
||||
56908-90078
|
||||
1890777
|
||||
51887300-
|
||||
7800900K
|
||||
100M
|
||||
2G
|
||||
.2T
|
37
tests/fixtures/sort/human-mixed-inputs-unique.txt
vendored
Normal file
37
tests/fixtures/sort/human-mixed-inputs-unique.txt
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
JAN
|
||||
|
||||
0000000
|
||||
|
||||
00
|
||||
|
||||
0001
|
||||
|
||||
1
|
||||
|
||||
-1.4
|
||||
|
||||
JUNNNN
|
||||
AUG
|
||||
|
||||
apr
|
||||
|
||||
APR
|
||||
|
||||
|
||||
MAY
|
||||
1890777
|
||||
|
||||
56908-90078
|
||||
|
||||
51887300-
|
||||
|
||||
6780.0009866
|
||||
|
||||
789----009999 90-0 90-0
|
||||
|
||||
6780.000986
|
||||
|
||||
100M
|
||||
7800900K
|
||||
2G
|
||||
.2T
|
37
tests/fixtures/sort/human-mixed-inputs.expected
vendored
Normal file
37
tests/fixtures/sort/human-mixed-inputs.expected
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
-1.4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
00
|
||||
0000000
|
||||
APR
|
||||
AUG
|
||||
JAN
|
||||
JUNNNN
|
||||
MAY
|
||||
apr
|
||||
0001
|
||||
1
|
||||
789----009999 90-0 90-0
|
||||
6780.000986
|
||||
6780.0009866
|
||||
56908-90078
|
||||
1890777
|
||||
51887300-
|
||||
7800900K
|
||||
100M
|
||||
2G
|
||||
.2T
|
46
tests/fixtures/sort/human-mixed-inputs.txt
vendored
Normal file
46
tests/fixtures/sort/human-mixed-inputs.txt
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
JAN
|
||||
|
||||
0000000
|
||||
|
||||
00
|
||||
|
||||
0001
|
||||
|
||||
1
|
||||
|
||||
-1.4
|
||||
|
||||
JUNNNN
|
||||
AUG
|
||||
|
||||
apr
|
||||
|
||||
APR
|
||||
|
||||
|
||||
MAY
|
||||
1890777
|
||||
|
||||
56908-90078
|
||||
|
||||
51887300-
|
||||
|
||||
6780.0009866
|
||||
|
||||
789----009999 90-0 90-0
|
||||
|
||||
6780.000986
|
||||
|
||||
1M
|
||||
10M
|
||||
100M
|
||||
1000M
|
||||
10000M
|
||||
|
||||
7800900K
|
||||
780090K
|
||||
78009K
|
||||
7800K
|
||||
780K
|
||||
2G
|
||||
.2T
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric.expected
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric.expected
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
-2028789030
|
||||
-896689
|
||||
-8.90880
|
||||
-1
|
||||
-.05
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
000
|
||||
CARAvan
|
||||
00000001
|
||||
1
|
||||
1.040000000
|
||||
1.444
|
||||
1.58590
|
||||
8.013
|
||||
45
|
||||
46.89
|
||||
4567.
|
||||
37800
|
||||
576,446.88800000
|
||||
576,446.890
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric.txt
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric.txt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
576,446.890
|
||||
576,446.88800000
|
||||
|
||||
|
||||
4567.
|
||||
45
|
||||
46.89
|
||||
-1
|
||||
1
|
||||
00000001
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
||||
|
||||
|
||||
37800
|
||||
|
||||
-2028789030
|
||||
-896689
|
||||
CARAvan
|
||||
|
||||
-8.90880
|
||||
-.05
|
||||
1.444
|
||||
1.58590
|
||||
1.040000000
|
||||
|
||||
8.013
|
||||
|
||||
000
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_reverse.expected
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_reverse.expected
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
4798908.8909800
|
||||
4798908.45
|
||||
4798908.340000000000
|
||||
576,446.890
|
||||
576,446.88800000
|
||||
37800
|
||||
4567.
|
||||
46.89
|
||||
45
|
||||
8.013
|
||||
1.58590
|
||||
1.444
|
||||
1.040000000
|
||||
1
|
||||
00000001
|
||||
CARAvan
|
||||
000
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-.05
|
||||
-1
|
||||
-8.90880
|
||||
-896689
|
||||
-2028789030
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_reverse_stable.expected
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_reverse_stable.expected
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
4798908.8909800
|
||||
4798908.45
|
||||
4798908.340000000000
|
||||
576,446.890
|
||||
576,446.88800000
|
||||
37800
|
||||
4567.
|
||||
46.89
|
||||
45
|
||||
8.013
|
||||
1.58590
|
||||
1.444
|
||||
1.040000000
|
||||
1
|
||||
00000001
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CARAvan
|
||||
|
||||
|
||||
|
||||
000
|
||||
-.05
|
||||
-1
|
||||
-8.90880
|
||||
-896689
|
||||
-2028789030
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_reverse_stable.txt
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_reverse_stable.txt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
576,446.890
|
||||
576,446.88800000
|
||||
|
||||
|
||||
4567.
|
||||
45
|
||||
46.89
|
||||
-1
|
||||
1
|
||||
00000001
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
||||
|
||||
|
||||
37800
|
||||
|
||||
-2028789030
|
||||
-896689
|
||||
CARAvan
|
||||
|
||||
-8.90880
|
||||
-.05
|
||||
1.444
|
||||
1.58590
|
||||
1.040000000
|
||||
|
||||
8.013
|
||||
|
||||
000
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_stable.expected
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_stable.expected
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
-2028789030
|
||||
-896689
|
||||
-8.90880
|
||||
-1
|
||||
-.05
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CARAvan
|
||||
|
||||
|
||||
|
||||
000
|
||||
1
|
||||
00000001
|
||||
1.040000000
|
||||
1.444
|
||||
1.58590
|
||||
8.013
|
||||
45
|
||||
46.89
|
||||
4567.
|
||||
37800
|
||||
576,446.88800000
|
||||
576,446.890
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_stable.txt
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_stable.txt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
576,446.890
|
||||
576,446.88800000
|
||||
|
||||
|
||||
4567.
|
||||
45
|
||||
46.89
|
||||
-1
|
||||
1
|
||||
00000001
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
||||
|
||||
|
||||
37800
|
||||
|
||||
-2028789030
|
||||
-896689
|
||||
CARAvan
|
||||
|
||||
-8.90880
|
||||
-.05
|
||||
1.444
|
||||
1.58590
|
||||
1.040000000
|
||||
|
||||
8.013
|
||||
|
||||
000
|
20
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique.expected
vendored
Normal file
20
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique.expected
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
-2028789030
|
||||
-896689
|
||||
-8.90880
|
||||
-1
|
||||
-.05
|
||||
|
||||
1
|
||||
1.040000000
|
||||
1.444
|
||||
1.58590
|
||||
8.013
|
||||
45
|
||||
46.89
|
||||
4567.
|
||||
37800
|
||||
576,446.88800000
|
||||
576,446.890
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique.txt
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique.txt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
576,446.890
|
||||
576,446.88800000
|
||||
|
||||
|
||||
4567.
|
||||
45
|
||||
46.89
|
||||
-1
|
||||
1
|
||||
00000001
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
||||
|
||||
|
||||
37800
|
||||
|
||||
-2028789030
|
||||
-896689
|
||||
CARAvan
|
||||
|
||||
-8.90880
|
||||
-.05
|
||||
1.444
|
||||
1.58590
|
||||
1.040000000
|
||||
|
||||
8.013
|
||||
|
||||
000
|
20
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_reverse.expected
vendored
Normal file
20
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_reverse.expected
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
4798908.8909800
|
||||
4798908.45
|
||||
4798908.340000000000
|
||||
576,446.890
|
||||
576,446.88800000
|
||||
37800
|
||||
4567.
|
||||
46.89
|
||||
45
|
||||
8.013
|
||||
1.58590
|
||||
1.444
|
||||
1.040000000
|
||||
1
|
||||
|
||||
-.05
|
||||
-1
|
||||
-8.90880
|
||||
-896689
|
||||
-2028789030
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_reverse.txt
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_reverse.txt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
576,446.890
|
||||
576,446.88800000
|
||||
|
||||
|
||||
4567.
|
||||
45
|
||||
46.89
|
||||
-1
|
||||
1
|
||||
00000001
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
||||
|
||||
|
||||
37800
|
||||
|
||||
-2028789030
|
||||
-896689
|
||||
CARAvan
|
||||
|
||||
-8.90880
|
||||
-.05
|
||||
1.444
|
||||
1.58590
|
||||
1.040000000
|
||||
|
||||
8.013
|
||||
|
||||
000
|
20
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_stable.expected
vendored
Normal file
20
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_stable.expected
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
4798908.8909800
|
||||
4798908.45
|
||||
4798908.340000000000
|
||||
576,446.890
|
||||
576,446.88800000
|
||||
37800
|
||||
4567.
|
||||
46.89
|
||||
45
|
||||
8.013
|
||||
1.58590
|
||||
1.444
|
||||
1.040000000
|
||||
1
|
||||
|
||||
-.05
|
||||
-1
|
||||
-8.90880
|
||||
-896689
|
||||
-2028789030
|
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_stable.txt
vendored
Normal file
30
tests/fixtures/sort/mixed_floats_ints_chars_numeric_unique_stable.txt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
576,446.890
|
||||
576,446.88800000
|
||||
|
||||
|
||||
4567.
|
||||
45
|
||||
46.89
|
||||
-1
|
||||
1
|
||||
00000001
|
||||
4798908.340000000000
|
||||
4798908.45
|
||||
4798908.8909800
|
||||
|
||||
|
||||
37800
|
||||
|
||||
-2028789030
|
||||
-896689
|
||||
CARAvan
|
||||
|
||||
-8.90880
|
||||
-.05
|
||||
1.444
|
||||
1.58590
|
||||
1.040000000
|
||||
|
||||
8.013
|
||||
|
||||
000
|
6
tests/fixtures/sort/months-dedup.expected
vendored
Normal file
6
tests/fixtures/sort/months-dedup.expected
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
JAN
|
||||
apr
|
||||
MAY
|
||||
JUNNNN
|
||||
AUG
|
37
tests/fixtures/sort/months-dedup.txt
vendored
Normal file
37
tests/fixtures/sort/months-dedup.txt
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
JAN
|
||||
|
||||
0000000
|
||||
|
||||
00
|
||||
|
||||
0001
|
||||
|
||||
1
|
||||
|
||||
-1.4
|
||||
|
||||
JUNNNN
|
||||
AUG
|
||||
|
||||
apr
|
||||
|
||||
APR
|
||||
|
||||
|
||||
MAY
|
||||
1890777
|
||||
|
||||
56908-90078
|
||||
|
||||
51887300-
|
||||
|
||||
6780.0009866
|
||||
|
||||
789----009999 90-0 90-0
|
||||
|
||||
6780.000986
|
||||
|
||||
100M
|
||||
7800900K
|
||||
2G
|
||||
.2T
|
23
tests/fixtures/sort/numeric-floats-with-nan2.expected
vendored
Normal file
23
tests/fixtures/sort/numeric-floats-with-nan2.expected
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
-8.90880
|
||||
-.05
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Karma
|
||||
1
|
||||
1.0/0.0
|
||||
1.040000000
|
||||
1.2
|
||||
1.444
|
||||
1.58590
|
23
tests/fixtures/sort/numeric-floats-with-nan2.txt
vendored
Normal file
23
tests/fixtures/sort/numeric-floats-with-nan2.txt
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
Karma
|
||||
|
||||
1.0/0.0
|
||||
|
||||
|
||||
-8.90880
|
||||
|
||||
|
||||
-.05
|
||||
|
||||
|
||||
1.040000000
|
||||
|
||||
1.444
|
||||
|
||||
|
||||
1.58590
|
||||
|
||||
|
||||
1
|
||||
|
||||
1.2
|
||||
|
BIN
tests/fixtures/sort/zero-terminated.expected
vendored
Normal file
BIN
tests/fixtures/sort/zero-terminated.expected
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/sort/zero-terminated.txt
vendored
Normal file
BIN
tests/fixtures/sort/zero-terminated.txt
vendored
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue