summaryrefslogtreecommitdiff
path: root/lib/locale.t
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-01-20 12:58:46 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-22 11:45:59 -0700
commitd369fd5b026662cae636af9907037fdd15fc4adb (patch)
treeeb62e013858864b9e3af7901fa4c65c79af77995 /lib/locale.t
parenta5dfa8d3f00186c1b4decd582515924aef2ebbd6 (diff)
downloadperl-d369fd5b026662cae636af9907037fdd15fc4adb.tar.gz
Move more common locale finding code into t/loc_tools.pl
As a result of some code meant to do the same thing being in two different places, one got updated, and one didn't. So t/run/locale.t was being skipped for Win32, even though the bug there it was avoiding has been fixed in XP.
Diffstat (limited to 'lib/locale.t')
-rw-r--r--lib/locale.t37
1 files changed, 11 insertions, 26 deletions
diff --git a/lib/locale.t b/lib/locale.t
index 57c9d0637d..43e660fe20 100644
--- a/lib/locale.t
+++ b/lib/locale.t
@@ -67,25 +67,6 @@ sub debugf {
printf @_ if $debug;
}
-my $have_setlocale = 0;
-eval {
- require POSIX;
- import POSIX ':locale_h';
- $have_setlocale++;
-};
-
-# Visual C's CRT goes silly on strings of the form "en_US.ISO8859-1"
-# and mingw32 uses said silly CRT
-# This doesn't seem to be an issue any more, at least on Windows XP,
-# so re-enable the tests for Windows XP onwards.
-my $winxp = ($^O eq 'MSWin32' && defined &Win32::GetOSVersion &&
- join('.', (Win32::GetOSVersion())[1..2]) >= 5.1);
-$have_setlocale = 0 if ((($^O eq 'MSWin32' && !$winxp) || $^O eq 'NetWare') &&
- $Config{cc} =~ /^(cl|gcc)/i);
-
-# UWIN seems to loop after taint tests, just skip for now
-$have_setlocale = 0 if ($^O =~ /^uwin/);
-
$a = 'abc %';
my $test_num = 0;
@@ -468,11 +449,6 @@ check_taint_not $1, '"foo.bar_baz" =~ /^(.*)[._](.*?)$/';
# Let us do some *real* locale work now,
# unless setlocale() is missing (i.e. minitest).
-unless ($have_setlocale) {
- print "1..$test_num\n";
- exit;
-}
-
# The test number before our first setlocale()
my $final_without_setlocale = $test_num;
@@ -480,8 +456,6 @@ my $final_without_setlocale = $test_num;
debug "# Scanning for locales...\n";
-setlocale(&POSIX::LC_ALL, "C");
-
my @Locale = find_locales();
debug "# Locales =\n";
@@ -489,6 +463,17 @@ for ( @Locale ) {
debug "# $_\n";
}
+unless (@Locale) {
+ print "1..$test_num\n";
+ exit;
+}
+
+# We shouldn't get this far unless we know this will succeed
+require POSIX;
+import POSIX ':locale_h';
+
+setlocale(&POSIX::LC_ALL, "C");
+
my %posixes;
my %Problem;