From: Robin Barker Date: Wed, 8 Nov 2006 15:18:23 +0000 (+0000) Subject: fails under minitest X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab7423222bba21f69873406be80957820f00b893;p=p5sagit%2Fp5-mst-13.2.git fails under minitest From: "Robin Barker" Message-ID: <2C2E01334A940D4792B3E115F95B7226120AA5@exchsvr1.npl.ad.local> p4raw-id: //depot/perl@29236 --- diff --git a/t/op/inccode.t b/t/op/inccode.t index d9516fa..a64716b 100644 --- a/t/op/inccode.t +++ b/t/op/inccode.t @@ -3,11 +3,14 @@ # Tests for the coderef-in-@INC feature my $can_fork = 0; +my $minitest = $ENV{PERL_CORE_MINITEST}; + BEGIN { chdir 't' if -d 't'; @INC = qw(. ../lib); } -{ + +if (!$minitest) { use Config; if (PerlIO::Layer->find('perlio') && $Config{d_fork} && eval 'require POSIX; 1') { @@ -19,7 +22,7 @@ use strict; use File::Spec; require "test.pl"; -plan(tests => 48 + 14 * $can_fork); +plan(tests => 45 + !$minitest * (3 + 14 * $can_fork)); my @tempfiles = (); @@ -197,6 +200,16 @@ my $ret = ""; $ret ||= do 'abc.pl'; is( $ret, 'abc', 'do "abc.pl" sees return value' ); +{ + my $filename = $^O eq 'MacOS' ? ':Foo:Foo.pm' : './Foo.pm'; + local @INC; + @INC = sub { $filename = 'seen'; return undef; }; + eval { require $filename; }; + is( $filename, 'seen', 'the coderef sees fully-qualified pathnames' ); +} + +exit if $minitest; + pop @INC; push @INC, sub { @@ -220,14 +233,6 @@ is( our $file, '/custom/path/to/Publius/Vergilius/Maro.pm', '__FILE__ set correc pop @INC; -my $filename = $^O eq 'MacOS' ? ':Foo:Foo.pm' : './Foo.pm'; -{ - local @INC; - @INC = sub { $filename = 'seen'; return undef; }; - eval { require $filename; }; - is( $filename, 'seen', 'the coderef sees fully-qualified pathnames' ); -} - if ($can_fork) { require PerlIO::scalar; # This little bundle of joy generates n more recursive use statements,