From b877ea4b3ee4c62ab75caedbfdcca4877961aedf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 6 Aug 2010 21:30:17 -0700 Subject: sort: support all combinations of -d, -f, -i, -R, and -V * NEWS: Document this. * src/sort.c (getmonth): Omit LEN arg, as MONTH is now null-terminated. (compare_random): Don't null-terminate keys, as caller now does that. (compare_version): Remove. (debug_key): Null-terminate string for getmonth. (keycompare): Support combining -R with any of -d, -f, -i, -V. Also, support combining -V with any of -d, -i. (check_ordering_compatibility): Allow newly-supported combinations. * tests/misc/sort (02q, 02r, 02s): New tests, for new combinations. (incompat2): Now test -nR, since -fR are now compatible. --- tests/misc/sort | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/misc/sort b/tests/misc/sort index 202951c67..fedbf278f 100755 --- a/tests/misc/sort +++ b/tests/misc/sort @@ -92,6 +92,10 @@ my @Tests = {ERR=>"$prog: -:3: disorder: B\n"}, $normalize_filename], ["02p", '-cu', {IN=>"B\nA\nB\n"}, {OUT=>''}, {EXIT=>1}, {ERR=>"$prog: -:2: disorder: A\n"}, $normalize_filename], +["02q", '-c -k 1,1fR', {IN=>"ABC\nABc\nAbC\nAbc\naBC\naBc\nabC\nabc\n"}], +["02r", '-c -k 1,1fV', {IN=>"ABC\nABc\nAbC\nAbc\naBC\naBc\nabC\nabc\n"}], +["02s", '-c -k 1,1dfR', + {IN=>".ABC\n.ABc.\nA.bC\nA.bc.\naB.C\naB.c.\nabC.\nabc..\n"}], # ["03a", '-k1', {IN=>"B\nA\n"}, {OUT=>"A\nB\n"}], ["03b", '-k1,1', {IN=>"B\nA\n"}, {OUT=>"A\nB\n"}], @@ -335,8 +339,8 @@ my @Tests = # Specifying incompatible options should evoke a failure. ["incompat1", '-in', {EXIT=>2}, {ERR=>"$prog: options `-in' are incompatible\n"}], -["incompat2", '-fR', {EXIT=>2}, - {ERR=>"$prog: options `-fR' are incompatible\n"}], +["incompat2", '-nR', {EXIT=>2}, + {ERR=>"$prog: options `-nR' are incompatible\n"}], ["incompat3", '-dfgiMnR', {EXIT=>2}, {ERR=>"$prog: options `-dfgMnR' are incompatible\n"}], ["incompat4", qw(-c -o /dev/null), {EXIT=>2}, -- cgit v1.2.3-70-g09d2