From eb1e30c213d0ee80347e581f21da30e8084b238c Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 27 Feb 2009 08:40:42 +0000 Subject: tests: sort: Check skipping blanks in multibyte locales * tests/misc/sort: On Fedora 8 at least, sort -k1b,1 mishandles blanks in multibyte locales, so add test. --- tests/misc/sort | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/misc/sort') diff --git a/tests/misc/sort b/tests/misc/sort index 3af2388a5..4f377df26 100755 --- a/tests/misc/sort +++ b/tests/misc/sort @@ -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"}], -- cgit v1.2.3-70-g09d2