mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
sort: compatibility of human-numeric sort
Closes #1985. This makes human-numeric sort follow the same algorithm as GNU's/FreeBSD's sort. As documented by GNU in https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html, we first compare by sign, then by si unit and finally by the numeric value.
This commit is contained in:
parent
fef8761ac1
commit
548a895cd6
6 changed files with 77 additions and 25 deletions
|
@ -1,3 +1,4 @@
|
|||
0K
|
||||
K
|
||||
844K
|
||||
981K
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
0K
|
||||
__
|
||||
__
|
||||
K
|
||||
^ no match for key
|
||||
_
|
||||
|
|
3
tests/fixtures/sort/human_block_sizes.txt
vendored
3
tests/fixtures/sort/human_block_sizes.txt
vendored
|
@ -9,4 +9,5 @@
|
|||
844K
|
||||
981K
|
||||
13M
|
||||
K
|
||||
K
|
||||
0K
|
Loading…
Add table
Add a link
Reference in a new issue