From acc01947af2e025d11016f3a4b0a26beb06dd120 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 30 Jun 2009 00:52:43 +0100 Subject: sort: allow SI and IEC units on separate human sort fields * src/sort.c: Store the si_present state per key rather than globally * tests/misc/sort: Add a check that would have previously failed. Also add a test to demonstrate that invalid IEC/SI mixtures are not always noticed when they're not significant to the sort. --- tests/misc/sort | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/misc/sort') diff --git a/tests/misc/sort b/tests/misc/sort index 21e7af8e9..b1f012059 100755 --- a/tests/misc/sort +++ b/tests/misc/sort @@ -71,6 +71,10 @@ my @Tests = {ERR=>"$prog: options `-hn' are incompatible\n"}], # check key processing ["h8", '-n -k2,2h', {IN=>"1 1E\n2 2M\n"}, {OUT=>"2 2M\n1 1E\n"}], +# SI and IEC prefixes on separate keys allowed +["h9", '-h -k1,1 -k2,2', {IN=>"1M 1Mi\n1M 1Mi\n"}, {OUT=>"1M 1Mi\n1M 1Mi\n"}], +# This invalid SI and IEC prefix mixture is not significant so not noticed +["h10", '-h -k1,1 -k2,2', {IN=>"1M 2M\n2M 1Mi\n"}, {OUT=>"1M 2M\n2M 1Mi\n"}], ["01a", '', {IN=>"A\nB\nC\n"}, {OUT=>"A\nB\nC\n"}], # -- cgit v1.2.3-70-g09d2