diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-01-24 13:14:21 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-01-24 13:14:21 +0000 |
commit | 27bcc0a7e6b15b7b0d6f632d5f31918abd005ef4 (patch) | |
tree | 8913aaf5a774174e598e6054220156d83eeb467b /t/comp | |
parent | 141db969318ed8140b5af01514c043bc7f710dc3 (diff) | |
download | perl-27bcc0a7e6b15b7b0d6f632d5f31918abd005ef4.tar.gz |
Revert change 23843.
(See discussion for bug [perl #31924])
p4raw-id: //depot/perl@23873
Diffstat (limited to 't/comp')
-rwxr-xr-x | t/comp/require.t | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/t/comp/require.t b/t/comp/require.t index 5d861d24ec..29f5436df7 100755 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -11,9 +11,8 @@ $i = 1; my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; -my $total_tests = 43; -my $ebcdic_utf8_skips = 3; -if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= $ebcdic_utf8_skips; } +my $total_tests = 44; +if ($Is_EBCDIC || $Is_UTF8) { $total_tests = 41; } print "1..$total_tests\n"; sub do_require { @@ -123,6 +122,8 @@ for my $expected_compile (1,0) { print "ok ",$i++,"\n"; print "not " unless -e $flag_file xor $expected_compile; print "ok ",$i++,"\n"; + print "not " unless exists $INC{'bleah.pm'}; + print "ok ",$i++,"\n"; } # compile-time failure in require @@ -132,6 +133,9 @@ do_require "1)\n"; print "# $@\nnot " unless $@ =~ /(syntax|parse) error/mi; print "ok ",$i++,"\n"; +# previous failure cached in %INC +print "not " unless exists $INC{'bleah.pm'}; +print "ok ",$i++,"\n"; write_file($flag_file, 1); write_file('bleah.pm', "unlink '$flag_file'; 1"); print "# $@\nnot " if eval { require 'bleah.pm' }; @@ -140,19 +144,13 @@ print "# $@\nnot " unless $@ =~ /Compilation failed/i; print "ok ",$i++,"\n"; print "not " unless -e $flag_file; print "ok ",$i++,"\n"; -# [perl #31924] -eval { $INC{'bleah.pm'} = 'bleah.pm' }; -print "# $@\nnot " if $@; -print "ok ",$i++,"\n"; -print "not " unless $INC{'bleah.pm'} eq 'bleah.pm'; +print "not " unless exists $INC{'bleah.pm'}; print "ok ",$i++,"\n"; # successful require do_require "1"; print "# $@\nnot " if $@; print "ok ",$i++,"\n"; -print "not " unless $INC{'bleah.pm'} eq 'bleah.pm'; -print "ok ",$i++,"\n"; # do FILE shouldn't see any outside lexicals my $x = "ok $i\n"; |