]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: sort: Check skipping blanks in multibyte locales
authorPádraig Brady <P@draigBrady.com>
Fri, 27 Feb 2009 08:40:42 +0000 (08:40 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 28 Feb 2009 01:09:18 +0000 (01:09 +0000)
* tests/misc/sort: On Fedora 8 at least, sort -k1b,1
mishandles blanks in multibyte locales, so add test.

tests/misc/sort

index 3af2388a584515067afa9ce4cd88e9c8d620098b..4f377df266687d3c8761d2439f9a379f6f654536 100755 (executable)
@@ -24,6 +24,10 @@ my $prog = 'sort';
 # Turn off localization of executable's output.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
 
+my $mb_locale = $ENV{LOCALE_FR_UTF8};
+! defined $mb_locale || $mb_locale eq 'none'
+  and $mb_locale = 'C';
+
 # Since each test is run with a file name and with redirected stdin,
 # the name in the diagnostic is either the file name or "-".
 # Normalize each diagnostic to use '-'.
@@ -216,6 +220,12 @@ my @Tests =
 # next field are not included in the sort. I.E. order should not change here.
 ["18f", '-k1,1b', {IN=>"a  y\na z\n"}, {OUT=>"a  y\na z\n"}],
 
+# When ignoring leading blanks for start position, ensure blanks from
+# next field are not included in the sort. I.E. order should not change here.
+# This was noticed as an issue on fedora 8 (only in multibyte locales).
+["18g", '-k1b,1', {IN=>"a  y\na z\n"}, {OUT=>"a  y\na z\n"},
+ {ENV => "LC_ALL=$mb_locale"}],
+
 # This looks odd, but works properly -- 2nd keyspec is never
 # used because all lines are different.
 ["19a", '+0 +1nr', {IN=>"b 2\nb 1\nb 3\n"}, {OUT=>"b 1\nb 2\nb 3\n"}],