From: Nicholas Clark Date: Fri, 9 Oct 2009 10:54:29 +0000 (+0200) Subject: Move the test for require 5.11.0 not loading strictures to require.t from use.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=91937335c7980d01674367559f12bd1ab53b6d56;p=p5sagit%2Fp5-mst-13.2.git Move the test for require 5.11.0 not loading strictures to require.t from use.t --- diff --git a/t/comp/require.t b/t/comp/require.t index e7d0da6..c3f0343 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -22,7 +22,7 @@ krunch.pm krunch.pmc whap.pm whap.pmc); my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; -my $total_tests = 47; +my $total_tests = 48; if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; } print "1..$total_tests\n"; @@ -93,6 +93,12 @@ print "ok ",$i++,"\n"; print "ok ",$i++,"\n"; } +# "use 5.11.0" (and higher) loads strictures. +# check that this doesn't happen with require +eval 'require 5.11.0; ${"foo"} = "bar";'; +print "# $@\nnot " if $@; +print "ok ",$i++,"\n"; + # interaction with pod (see the eof) write_file('bleah.pm', "print 'ok $i\n'; 1;\n"); require "bleah.pm"; diff --git a/t/comp/use.t b/t/comp/use.t index ba7d587..fade9fe 100755 --- a/t/comp/use.t +++ b/t/comp/use.t @@ -6,7 +6,7 @@ BEGIN { $INC{"feature.pm"} = 1; # so we don't attempt to load feature.pm } -print "1..70\n"; +print "1..69\n"; # Can't require test.pl, as we're testing the use/require mechanism here. @@ -122,9 +122,6 @@ is ($@, ""); # and they are properly scoped eval '{use 5.11.0;} ${"foo"} = "bar";'; is ($@, ""); -# and this doesn't happen with require -eval 'require 5.11.0; ${"foo"} = "bar";'; -is ($@, ""); { use test_use } # check that subparse saves pending tokens