In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/81bccfe42ad445b6e06432af7d7657baccd86a50?hp=8b46c09ba8a3ae75055618a6e0bb4da2fac1b138>

- Log -----------------------------------------------------------------
commit 81bccfe42ad445b6e06432af7d7657baccd86a50
Author: Father Chrysostomos <[email protected]>
Date:   Thu Dec 8 08:42:31 2011 -0800

    Fix use VERSION test failures under PERL_UNICODE
    
    use VERSION now checks whether HINT_LOCALIZE_HH is set, which indi-
    cates that %^H has been modified.  If it is set, it does ‘no feature’
    first, regardless of the version number.
    
    Some tests were checking that feature.pm is not loaded for use 5.8.8.
    Now it is sometimes, particularly if PERL_UNICODE has been set, as it
    adds keys to %^H.
    
    For now, I’ve tweaked the tests.  It would be nice if version declara-
    tions could load and unload features without loading feature.pm, just
    as they do with strictures.
-----------------------------------------------------------------------

Summary of changes:
 t/lib/feature/implicit |    6 +++---
 t/op/override.t        |   10 ++++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/t/lib/feature/implicit b/t/lib/feature/implicit
index 3a82f01..e2ae95a 100644
--- a/t/lib/feature/implicit
+++ b/t/lib/feature/implicit
@@ -25,11 +25,11 @@ say defined $INC{"feature.pm"} ? "Helloworld" : "Good bye";
 EXPECT
 Helloworld
 ########
-# VERSION requirement, doesn't load anything for < 5.9.5
+# VERSION requirement, doesn't call feature->import for < 5.9.5
+BEGIN { ++$INC{"feature.pm"} }
+sub feature::import { print "improting\n" }
 use 5.8.8;
-print "<".$INC{"feature.pm"}.">\n";
 EXPECT
-<>
 ########
 # VERSION requirement, doesn't load anything with require
 require 5.9.5;
diff --git a/t/op/override.t b/t/op/override.t
index ab2cbf1..be39cf9 100644
--- a/t/op/override.t
+++ b/t/op/override.t
@@ -49,8 +49,14 @@ is( $r, "Foo.pm" );
 eval "use Foo::Bar";
 is( $r, join($dirsep, "Foo", "Bar.pm") );
 
-eval "use 5.006";
-is( $r, "5.006" );
+# Under PERL_UNICODE, %^H is set, causing Perl_utilize to require
+# feature.pm after 5.006, in order to turn off features.  Stop that
+# from interfering with this test by unsetting HINT_LOCALIZE_HH.
+{
+    BEGIN { $^H &= ~0x00020000 } # HINT_LOCALIZE_HH
+    eval "use 5.006";
+    is( $r, "5.006" );
+}
 
 {
     local $_ = 'foo.pm';

--
Perl5 Master Repository

Reply via email to