1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-16 18:21:01 +00:00
uutils-coreutils/tests/fixtures/sort
Michael Debertol 4bbbe3a3f2
sort: implement numeric string comparison (#2070)
* sort: implement numeric string comparison

This implements -n and -h using a string comparison algorithm instead
of parsing each number to a f64 and comparing those.

This should result in a moderate performance increase and eliminate loss
of precision.

* cache parsed f64 numbers

For general numeric comparisons we have to parse numbers as f64,
as this behavior is explicitly documented by GNU coreutils.
We can however cache the parsed value to speed up comparisons.

* fix leading zeroes for negative numbers

* use more appropriate name for exponent

* improvements to the parse function

* move checks into main loop and fix thousands separator condition

* remove unneeded checks

* rustfmt
2021-04-17 13:49:35 +02:00
..
check_fail.txt sort: Support check 2016-06-14 22:21:30 +03:00
default_unsorted_ints.expected tests/sort: add test for default mode 2016-03-29 00:58:24 -04:00
default_unsorted_ints.txt tests/sort: add test for default mode 2016-03-29 00:58:24 -04:00
dictionary_order.expected sort: add "dictionary-order" flag. 2020-05-07 23:08:24 +02:00
dictionary_order.txt sort: add "dictionary-order" flag. 2020-05-07 23:08:24 +02:00
exponents-positive-general.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
exponents-positive-general.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
exponents-positive-numeric.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
exponents-positive-numeric.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs-reverse.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs-reverse.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs-stable.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs-stable.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs-unique.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs-unique.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-mixed-inputs.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
human-numeric-whitespace.expected Sort: More small fixes (#2065) 2021-04-17 10:06:19 +02:00
human-numeric-whitespace.txt Sort: More small fixes (#2065) 2021-04-17 10:06:19 +02:00
human_block_sizes.expected tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
human_block_sizes.txt tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
ignore_case.expected sort: Implement ignore-case 2017-01-21 13:30:22 -05:00
ignore_case.txt sort: Implement ignore-case 2017-01-21 13:30:22 -05:00
merge_ints_interleaved.expected sort --merge works, but ignores --unique and --reverse 2016-08-13 00:42:43 +01:00
merge_ints_interleaved_1.txt sort --merge works, but ignores --unique and --reverse 2016-08-13 00:42:43 +01:00
merge_ints_interleaved_2.txt sort --merge works, but ignores --unique and --reverse 2016-08-13 00:42:43 +01:00
merge_ints_interleaved_3.txt sort --merge works, but ignores --unique and --reverse 2016-08-13 00:42:43 +01:00
merge_ints_reversed.expected sort: make compare_by honour settings.reverse 2016-08-13 00:42:43 +01:00
merge_ints_reversed_1.txt sort: make compare_by honour settings.reverse 2016-08-13 00:42:43 +01:00
merge_ints_reversed_2.txt sort: make compare_by honour settings.reverse 2016-08-13 00:42:43 +01:00
merge_ints_reversed_3.txt sort: make compare_by honour settings.reverse 2016-08-13 00:42:43 +01:00
mixed_floats_ints_chars_numeric.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_reverse.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_reverse_stable.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_reverse_stable.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_stable.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_stable.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_unique.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_unique.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_unique_reverse.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_unique_reverse.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_unique_reverse_stable.expected Sort: Various fixes and performance improvements (#2057) 2021-04-10 11:56:20 +02:00
mixed_floats_ints_chars_numeric_unique_stable.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
mixed_floats_ints_chars_numeric_unique_stable.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
month_default.expected implement sort --stable 2016-08-03 07:56:40 +01:00
month_default.txt implement sort --stable 2016-08-03 07:56:40 +01:00
month_stable.expected implement sort --stable 2016-08-03 07:56:40 +01:00
month_stable.txt implement sort --stable 2016-08-03 07:56:40 +01:00
months-dedup.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
months-dedup.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
months-whitespace.expected Sort: More small fixes (#2065) 2021-04-17 10:06:19 +02:00
months-whitespace.txt Sort: More small fixes (#2065) 2021-04-17 10:06:19 +02:00
multiple_decimals.expected Sort: Various fixes and performance improvements (#2057) 2021-04-10 11:56:20 +02:00
multiple_decimals_general.txt Sort: Various fixes and performance improvements (#2057) 2021-04-10 11:56:20 +02:00
multiple_decimals_numeric.expected sort: implement numeric string comparison (#2070) 2021-04-17 13:49:35 +02:00
multiple_decimals_numeric.txt Sort: Various fixes and performance improvements (#2057) 2021-04-10 11:56:20 +02:00
multiple_files.expected sort: support multiple input files 2016-06-14 21:25:29 +03:00
multiple_files1.txt sort: support multiple input files 2016-06-14 21:25:29 +03:00
multiple_files2.txt sort: support multiple input files 2016-06-14 21:25:29 +03:00
numeric-floats-with-nan2.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
numeric-floats-with-nan2.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
numeric_fixed_floats.expected tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_fixed_floats.txt tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_floats.expected tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_floats.txt tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_floats_and_ints.expected tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_floats_and_ints.txt tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_floats_with_nan.expected tests: untrimmed stdout assertion (fix #1235) 2019-02-08 07:54:48 +11:00
numeric_floats_with_nan.txt tests: untrimmed stdout assertion (fix #1235) 2019-02-08 07:54:48 +11:00
numeric_unfixed_floats.expected tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_unfixed_floats.txt tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_unique.expected sort: dedup using compare_by (#2064) 2021-04-10 19:49:10 +02:00
numeric_unique.txt sort: dedup using compare_by (#2064) 2021-04-10 19:49:10 +02:00
numeric_unsorted_ints.expected tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_unsorted_ints.txt tests/sort: refactor to match other tests 2016-03-29 00:58:24 -04:00
numeric_unsorted_ints_unique.expected sort: unique option support 2016-06-11 15:46:41 +03:00
numeric_unsorted_ints_unique.txt sort: unique option support 2016-06-11 15:46:41 +03:00
version-empty-lines.expected Sort: More small fixes (#2065) 2021-04-17 10:06:19 +02:00
version-empty-lines.txt Sort: More small fixes (#2065) 2021-04-17 10:06:19 +02:00
version.expected sort: Version sort support 2016-06-14 20:33:09 +03:00
version.txt sort: Version sort support 2016-06-14 20:33:09 +03:00
words_unique.expected sort: dedup using compare_by (#2064) 2021-04-10 19:49:10 +02:00
words_unique.txt sort: dedup using compare_by (#2064) 2021-04-10 19:49:10 +02:00
zero-terminated.expected Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00
zero-terminated.txt Sort: Implement stable sort, ignore non-printing, month sort dedup, auto parallel sort through rayon, zero terminated sort, check silent (#2008) 2021-04-08 22:07:09 +02:00