This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX math: s = "0" is not happy with -Wwrite-strings.
[perl5.git] / lib / locale.t
index 7c97db0..31b40f9 100644 (file)
@@ -917,12 +917,7 @@ foreach my $Locale (@Locale) {
 
     debug "is utf8 locale? = $is_utf8_locale\n";
 
-    my $radix = localeconv()->{decimal_point};
-    if ($radix !~ / ^ [[:ascii:]] + $/x) {
-        use bytes;
-        $radix = disp_chars(split "", $radix);
-    }
-    debug "radix = $radix\n";
+    debug "radix = " . disp_str(localeconv()->{decimal_point}) . "\n";
 
     if (! $is_utf8_locale) {
         use locale;
@@ -1846,18 +1841,18 @@ foreach my $Locale (@Locale) {
             $ok14 = 1;
             $ok14_5 = 1;
             if (setlocale(&POSIX::LC_MESSAGES, $Locale)) {
-            foreach my $err (keys %!) {
-                use Errno;
-                $! = eval "&Errno::$err";   # Convert to strerror() output
-                my $strerror = "$!";
-                if ("$strerror" =~ /\P{ASCII}/) {
-                    $ok14 = utf8::is_utf8($strerror);
-                    no locale;
-                    $ok14_5 = "$!" !~ /\P{ASCII}/;
-                    last;
+                foreach my $err (keys %!) {
+                    use Errno;
+                    $! = eval "&Errno::$err";   # Convert to strerror() output
+                    my $strerror = "$!";
+                    if ("$strerror" =~ /\P{ASCII}/) {
+                        $ok14 = utf8::is_utf8($strerror);
+                        no locale;
+                        $ok14_5 = "$!" !~ /\P{ASCII}/;
+                        last;
+                    }
                 }
             }
-            }
 
             # Similarly, we verify that a non-ASCII radix is in UTF-8.  This
             # also catches if there is a disparity between sprintf and
@@ -2228,12 +2223,14 @@ foreach $test_num ($first_locales_test_number..$final_locales_test_number) {
                     print "# problem is not likely to be Perl's\n";
                 }
             }
-            elsif ($debug) {
+            if ($debug) {
                 print "# $percent_fail% of locales (",
                       scalar(keys $Problem{$test_num}),
                       " of ",
                       scalar(@Locale),
-                      ") fail the following test\n";
+                      ") fail the above test (TODO cut-off is ",
+                      $acceptable_failure_percentage,
+                      "%)\n";
             }
         }
         print "#\n";