SYN SYN
[p5sagit/p5-mst-13.2.git] / t / pragma / locale.t
index 6265cce..c8a0df8 100755 (executable)
@@ -2,7 +2,7 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    @INC = '../lib';
     unshift @INC, '.';
     require Config; import Config;
     if (!$Config{d_setlocale} || $Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
@@ -52,7 +52,7 @@ sub ok {
 # even the default locale will taint under 'use locale'.
 
 sub is_tainted { # hello, camel two.
-    local $^W; # no warnings 'undef'
+    no warnings 'uninitialized' ;
     my $dummy;
     not eval { $dummy = join("", @_), kill 0; 1 }
 }
@@ -582,9 +582,9 @@ foreach $Locale (@Locale) {
     tryneoalpha($Locale, 104, $c eq $d); 
 
     {
+       use warnings;
        my $w = 0;
        local $SIG{__WARN__} = sub { $w++ };
-       local $^W = 1;
 
        # the == (among other ops) used to warn for locales
        # that had something else than "." as the radix character
@@ -664,6 +664,7 @@ foreach $Locale (@Locale) {
        print "# testing 116 failed for locale '$Locale' for characters @f\n"
             if @f;
     }
+
 }
 
 # Recount the errors.
@@ -709,26 +710,30 @@ EOW
     }
 }
 
-# Tell which locales ere okay.
+# Tell which locales were okay.
 
 if ($didwarn) {
     my @s;
     
     foreach my $l (@Locale) {
        my $p = 0;
-       foreach my $t (102..102) {
+       foreach my $t (102..116) {
            $p++ if $Problem{$t}{$l};
        }
        push @s, $l if $p == 0;
     }
     
-    my $s = join(" ", @s);
-    $s =~ s/(.{50,60}) /$1\n#\t/g;
-
-    warn
-       "# The following locales\n#\n",
-        "#\t", $s, "\n#\n",
-       "# tested okay.\n#\n",
+    if (@s) {
+        my $s = join(" ", @s);
+        $s =~ s/(.{50,60}) /$1\n#\t/g;
+
+        warn
+           "# The following locales\n#\n",
+            "#\t", $s, "\n#\n",
+           "# tested okay.\n#\n",
+    } else {
+        warn "# None of your locales was fully okay.\n";
+    }
 }
 
 # eof