aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-09-19 22:06:40 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-09-19 22:06:40 +0200
commit8aa7cf305ba5133721aa9852b398cbf1867fc857 (patch)
tree996b5b68c9b4004ffd65d954f19f5bbbe21bc71b /testsuite
parentf085344d5c4de46d0ef3e15a97ef444fd7cc3194 (diff)
downloadbusybox-w32-8aa7cf305ba5133721aa9852b398cbf1867fc857.tar.gz
busybox-w32-8aa7cf305ba5133721aa9852b398cbf1867fc857.tar.bz2
busybox-w32-8aa7cf305ba5133721aa9852b398cbf1867fc857.zip
sort: fix -kN,M handling (was including last separator into the comparison)
Testcase: $ printf '%s\n' a/a:a a:b | sort -t: -k1,1 a:b a/a:a Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/sort.tests8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/sort.tests b/testsuite/sort.tests
index 68fa3e405..c4b223464 100755
--- a/testsuite/sort.tests
+++ b/testsuite/sort.tests
@@ -98,6 +98,14 @@ testing "sort with non-default leading delim 3" "sort -n -k3 -t/ input" "\
98//b/1 98//b/1
99" "" 99" ""
100 100
101testing "sort with non-default leading delim 4" "sort -t: -k1,1 input" "\
102a:b
103a/a:a
104" "\
105a/a:a
106a:b
107" ""
108
101testing "sort -u should consider field only when discarding" "sort -u -k2 input" "\ 109testing "sort -u should consider field only when discarding" "sort -u -k2 input" "\
102a c 110a c
103" "\ 111" "\