summaryrefslogtreecommitdiff
path: root/t/comp/require.t
diff options
context:
space:
mode:
authorRick Delaney <rick@consumercontact.com>2004-10-13 08:40:18 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-01-21 13:35:49 +0000
commit10ac92784f49d4a1fe54cc1ed7d05f0d3b2a2f29 (patch)
tree4cca0a2e6335a7643ffd197e409d74d5827ab231 /t/comp/require.t
parent049f818b9a6d0ed6efed5c49515a9d137e475267 (diff)
downloadperl-10ac92784f49d4a1fe54cc1ed7d05f0d3b2a2f29.tar.gz
Re: [perl #31924] %INC caching failure-case problem
Message-ID: <20041013164018.GA32174@biff.bort.ca> p4raw-id: //depot/perl@23843
Diffstat (limited to 't/comp/require.t')
-rwxr-xr-xt/comp/require.t18
1 files changed, 10 insertions, 8 deletions
diff --git a/t/comp/require.t b/t/comp/require.t
index 29f5436df7..5d861d24ec 100755
--- a/t/comp/require.t
+++ b/t/comp/require.t
@@ -11,8 +11,9 @@ $i = 1;
my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0;
my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/;
-my $total_tests = 44;
-if ($Is_EBCDIC || $Is_UTF8) { $total_tests = 41; }
+my $total_tests = 43;
+my $ebcdic_utf8_skips = 3;
+if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= $ebcdic_utf8_skips; }
print "1..$total_tests\n";
sub do_require {
@@ -122,8 +123,6 @@ 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
@@ -133,9 +132,6 @@ 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' };
@@ -144,13 +140,19 @@ print "# $@\nnot " unless $@ =~ /Compilation failed/i;
print "ok ",$i++,"\n";
print "not " unless -e $flag_file;
print "ok ",$i++,"\n";
-print "not " unless exists $INC{'bleah.pm'};
+# [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 "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";