summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-02-08 16:05:25 +0000
committerPádraig Brady <P@draigBrady.com>2013-02-10 05:04:09 +0000
commit54deb54db989dde759410af9918802961c43bc58 (patch)
tree9ed255df11b6a3f27770c17e3ba43200e9252214 /tests
parent1f1f41db85c559285c9969e1a1a3430a872d0722 (diff)
downloadcoreutils-54deb54db989dde759410af9918802961c43bc58.tar.xz
tests: skip numfmt grouping tests on some systems
* tests/misc/numfmt.pl: When the system locale grouping doesn't match our expected format for grouping 1234 in the fr_FR locale, reset the locale to 'C' so as to skip all locale tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/misc/numfmt.pl16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/misc/numfmt.pl b/tests/misc/numfmt.pl
index c542483f0..b46e4d55b 100644
--- a/tests/misc/numfmt.pl
+++ b/tests/misc/numfmt.pl
@@ -883,7 +883,21 @@ my @Locale_Tests =
{ENV=>"LC_ALL=$locale"}],
);
-push @Tests, @Locale_Tests if $locale ne "C";
+if ($locale ne 'C')
+ {
+ # Reset locale to 'C' if LOCALE_FR_UTF8 doesn't output as expected
+ # as determined by the separate printf program.
+ open(LOC_NUM, "LC_ALL=$locale printf \"%'d\" 1234|")
+ or die "Can't fork command: $!";
+ my $loc_num = <LOC_NUM>;
+ close(LOC_NUM) || die "Failed to read grouped number from printf";
+ if ($loc_num ne '1 234')
+ {
+ warn "skipping locale grouping tests as 1234 groups like $loc_num\n";
+ $locale = 'C';
+ }
+ }
+push @Tests, @Locale_Tests if $locale ne 'C';
## Check all valid/invalid suffixes
foreach my $suf ( 'A' .. 'Z', 'a' .. 'z' ) {