diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/uniq.pl | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/tests/misc/uniq.pl b/tests/misc/uniq.pl index 4640b1488..1d14cd97f 100755 --- a/tests/misc/uniq.pl +++ b/tests/misc/uniq.pl @@ -80,23 +80,8 @@ sub add_z_variants($) return @new; } -# I've only ever triggered the problem in a non-C locale. -my $locale = $ENV{LOCALE_FR}; -! defined $locale || $locale eq 'none' - and CuSkip::skip "$prog: skipping this test -- no appropriate locale\n"; - -# See if isblank returns true for nbsp. -my $x = qx!env printf '\xa0'| LC_ALL=$locale tr '[:blank:]' x!; -# If so, expect just one line of output in the schar test. -# Otherwise, expect two. -my $in = " y z\n\xa0 y z\n"; -my $schar_exp = $x eq 'x' ? " y z\n" : $in; - my @Tests = ( - # Test for a subtle, system-and-locale-dependent bug in uniq. - ['schar', '-f1', {IN => $in}, {OUT => $schar_exp}, - {ENV => "LC_ALL=$locale"}], ['1', '', {IN=>''}, {OUT=>''}], ['2', '', {IN=>"a\na\n"}, {OUT=>"a\n"}], ['3', '', {IN=>"a\na"}, {OUT=>"a\n"}], @@ -244,6 +229,31 @@ my @Tests = "Try '$prog --help' for more information.\n"}], ); +# Locale related tests + +my $locale = $ENV{LOCALE_FR}; +if ( defined $locale && $locale ne 'none' ) + { + # I've only ever triggered the problem in a non-C locale. + + # See if isblank returns true for nbsp. + my $x = qx!env printf '\xa0'| LC_ALL=$locale tr '[:blank:]' x!; + # If so, expect just one line of output in the schar test. + # Otherwise, expect two. + my $in = " y z\n\xa0 y z\n"; + my $schar_exp = $x eq 'x' ? " y z\n" : $in; + + my @Locale_Tests = + ( + # Test for a subtle, system-and-locale-dependent bug in uniq. + ['schar', '-f1', {IN => $in}, {OUT => $schar_exp}, + {ENV => "LC_ALL=$locale"}] + ); + + push @Tests, @Locale_Tests; + } + + # Set _POSIX2_VERSION=199209 in the environment of each obs-plus* test. foreach my $t (@Tests) { |