diff options
author | Pádraig Brady <P@draigBrady.com> | 2009-02-27 08:40:42 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2009-02-28 01:09:18 +0000 |
commit | eb1e30c213d0ee80347e581f21da30e8084b238c (patch) | |
tree | 0ef9eeaf82fb7b3b0a81e76e8e6c1b97f777902d /tests | |
parent | d88c9f95e38cb86460ba4acaf90b24c3c8fce8bf (diff) | |
download | coreutils-eb1e30c213d0ee80347e581f21da30e8084b238c.tar.xz |
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.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/sort | 10 |
1 files changed, 10 insertions, 0 deletions
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"}], |