sort: fix key with delimiters breakage

function                                             old     new   delta
get_key                                              509     505      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2015-10-19 14:44:51 +02:00
parent 3d0805e9e7
commit 2e86a5c98d
2 changed files with 52 additions and 5 deletions

View File

@@ -106,6 +106,42 @@ a/a:a
a:b
" ""
testing "glibc build sort" "sort -t. -k 1,1 -k 2n,2n -k 3 input" "\
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.10
GLIBC_2.20
GLIBC_2.21
" "\
GLIBC_2.21
GLIBC_2.1.1
GLIBC_2.2.1
GLIBC_2.2
GLIBC_2.20
GLIBC_2.10
GLIBC_2.1
" ""
testing "glibc build sort unique" "sort -u -t. -k 1,1 -k 2n,2n -k 3 input" "\
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.10
GLIBC_2.20
GLIBC_2.21
" "\
GLIBC_2.10
GLIBC_2.2.1
GLIBC_2.1.1
GLIBC_2.20
GLIBC_2.2
GLIBC_2.1
GLIBC_2.21
" ""
testing "sort -u should consider field only when discarding" "sort -u -k2 input" "\
a c
" "\