In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0e18027d899d188a3a156a060d56beb9bfa7ddae?hp=b84fcea1379635ea045b01844a3500c17ce17b96>

- Log -----------------------------------------------------------------
commit 0e18027d899d188a3a156a060d56beb9bfa7ddae
Author: Karl Williamson <[email protected]>
Date:   Tue Feb 19 13:56:20 2013 -0700

    re/charset.t, re/fold_grind.t: Note C locale can match 128-255
    
    Craig Berry pointed out that an implementation can have the C locale
    give meanings to the above-ASCII code points.  (I had thought this was
    an error.)  Change label name and comments in these .t files
    correspondingly.

M       t/re/charset.t
M       t/re/fold_grind.t

commit ed35198c46e1299c54bc9728548919ce30ec223d
Author: Karl Williamson <[email protected]>
Date:   Sun Feb 17 12:27:03 2013 -0700

    re/charset.t: Make sure locale is loaded at compile time
    
    Commit 569f7fc5d4ec06501b46a72075ff434fe1bf4332 caused this test file
    to start failing on VMS.  The reason is that the test for locale became
    run-time.  This patch restores the test to compile time, by using the
    'if' module.
    
    The reason 'if' wasn't used in the original patch was to reduce reliance
    on possibly untested modules, but it makes things easier.  We hope to
    get a resolution on p5p on which test groups in the suite can use things
    like 'if', but since 5.17.9 is due out momentarily, I'm using 'if' for
    now so that VMS will pass its tests again.

M       t/re/charset.t
-----------------------------------------------------------------------

Summary of changes:
 t/re/charset.t    |   17 +++++++++++------
 t/re/fold_grind.t |   10 ++++++----
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/t/re/charset.t b/t/re/charset.t
index ee3625a..a1e3be1 100644
--- a/t/re/charset.t
+++ b/t/re/charset.t
@@ -3,12 +3,12 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
-    require Config; import Config;
     require './test.pl';
 }
 
 use strict;
 use warnings;
+use Config;
 
 plan('no_plan');
 
@@ -40,15 +40,20 @@ if (! is_miniperl() && $Config{d_setlocale}) {
     require POSIX;
     my $current_locale = POSIX::setlocale( &POSIX::LC_ALL, "C") // "";
     if ($current_locale eq 'C') {
-        require locale; import locale;
 
-        # Some locale implementations don't have the 128-255 characters all
-        # mean nothing.  Skip the locale tests in that situation
+        # test for d_setlocale is repeated here because this one is compile
+        # time, and the one above is run time
+        use if $Config{d_setlocale}, 'locale';
+
+        # Some implementations don't have the 128-255 range characters all
+        # mean nothing under the C locale (an example being VMS).  This is
+        # legal, but since we don't know what the right answers should be,
+        # skip the locale tests in that situation.
         for my $i (128 .. 255) {
-            goto bad_locale if chr($i) =~ /[[:print:]]/;
+            goto untestable_locale if chr($i) =~ /[[:print:]]/;
         }
         push @charsets, 'l';
-    bad_locale:
+    untestable_locale:
     }
 }
 
diff --git a/t/re/fold_grind.t b/t/re/fold_grind.t
index d073498..3267336 100644
--- a/t/re/fold_grind.t
+++ b/t/re/fold_grind.t
@@ -411,14 +411,16 @@ if($Config{d_setlocale}) {
     if ($current_locale eq 'C') {
         require locale; import locale;
 
-        # Some locale implementations don't have the range 128-255 characters 
all
-        # mean nothing.  Skip the locale tests in that situation.
+        # Some implementations don't have the 128-255 range characters all
+        # mean nothing under the C locale (an example being VMS).  This is
+        # legal, but since we don't know what the right answers should be,
+        # skip the locale tests in that situation.
         for my $i (128 .. 255) {
             my $char = chr($i);
-            goto bad_locale if uc($char) ne $char || lc($char) ne $char;
+            goto untestable_locale if uc($char) ne $char || lc($char) ne $char;
         }
         push @charsets, 'l';
-      bad_locale:
+      untestable_locale:
     }
 }
 

--
Perl5 Master Repository

Reply via email to