summaryrefslogtreecommitdiff
path: root/tests/misc
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2013-02-28 23:34:49 +0000
committerPádraig Brady <P@draigBrady.com>2013-02-28 23:35:45 +0000
commit0a16f9732dee129315dd916eddb320039301df1b (patch)
treefd4a4b9455d5ed9afad6d6abaa0d60776d23d53a /tests/misc
parent374f569579fe4e319d592f4d77ae1ede5566eed6 (diff)
downloadcoreutils-0a16f9732dee129315dd916eddb320039301df1b.tar.xz
tests: don't skip all uniq tests when locale is missing
* tests/misc/uniq.pl: Previously, if LOCALE_FR was not defined, all tests would be skipped. Modified to skip only the relevant test.
Diffstat (limited to 'tests/misc')
-rwxr-xr-xtests/misc/uniq.pl40
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)
{