diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-08 08:42:31 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-08 08:42:31 -0800 |
commit | 81bccfe42ad445b6e06432af7d7657baccd86a50 (patch) | |
tree | df4834b0d5e9c54a2108656c0bdd92ef153b1bee /t | |
parent | 8b46c09ba8a3ae75055618a6e0bb4da2fac1b138 (diff) | |
download | perl-81bccfe42ad445b6e06432af7d7657baccd86a50.tar.gz |
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.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/feature/implicit | 6 | ||||
-rw-r--r-- | 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 3a82f01594..e2ae95a19d 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 ab2cbf1515..be39cf9330 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'; |