summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRick Delaney <rick@consumercontact.com>2006-12-15 18:28:25 -0500
committerSteve Peters <steve@fisharerojo.org>2006-12-18 15:36:11 +0000
commitc38a65302a7e2e2ea9b8748d368c87d573add6fd (patch)
tree1dff559dcefc23bbb14ba21e194e8d9712ab428e /t
parent1151960ed7fc317458b67c83e733c90ee7bbf4fd (diff)
downloadperl-c38a65302a7e2e2ea9b8748d368c87d573add6fd.tar.gz
Re: [perl #41071] require stringifies code references in tied @INC
Message-ID: <20061216042825.GB23501@localhost.localdomain> p4raw-id: //depot/perl@29584
Diffstat (limited to 't')
-rw-r--r--t/op/inccode-tie.t15
-rw-r--r--t/op/inccode.t4
2 files changed, 18 insertions, 1 deletions
diff --git a/t/op/inccode-tie.t b/t/op/inccode-tie.t
new file mode 100644
index 0000000000..43388dd050
--- /dev/null
+++ b/t/op/inccode-tie.t
@@ -0,0 +1,15 @@
+#!./perl
+
+# Calls all tests in op/inccode.t after tying @INC first.
+
+use Tie::Array;
+my @orig_INC = @INC;
+tie @INC, 'Tie::StdArray';
+@INC = @orig_INC;
+for my $file ('./op/inccode.t', './t/op/inccode.t', ':op:inccode.t') {
+ if (-r $file) {
+ do $file;
+ exit;
+ }
+}
+die "Cannot find ./op/inccode.t or ./t/op/inccode.t\n";
diff --git a/t/op/inccode.t b/t/op/inccode.t
index a64716bfb9..268d4f46bc 100644
--- a/t/op/inccode.t
+++ b/t/op/inccode.t
@@ -202,10 +202,12 @@ is( $ret, 'abc', 'do "abc.pl" sees return value' );
{
my $filename = $^O eq 'MacOS' ? ':Foo:Foo.pm' : './Foo.pm';
- local @INC;
+ #local @INC; # local fails on tied @INC
+ my @old_INC = @INC; # because local doesn't work on tied arrays
@INC = sub { $filename = 'seen'; return undef; };
eval { require $filename; };
is( $filename, 'seen', 'the coderef sees fully-qualified pathnames' );
+ @INC = @old_INC;
}
exit if $minitest;