This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make Peek.t easier to run directly
authorFather Chrysostomos <sprout@cpan.org>
Thu, 28 Aug 2014 01:10:18 +0000 (18:10 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 28 Aug 2014 20:04:18 +0000 (13:04 -0700)
e.g., ./perl -TIlib ext/Devel-Peek/t/Peek.t

ext/Devel-Peek/t/Peek.t

index a38d909..583894d 100644 (file)
@@ -1474,6 +1474,7 @@ for my $test (
 
 }
 
 
 }
 
+my $runperl_args = { switches => ['-Ilib'] };
 sub test_DumpProg {
     my ($prog, $expected, $name, $test) = @_;
     $test ||= 'like';
 sub test_DumpProg {
     my ($prog, $expected, $name, $test) = @_;
     $test ||= 'like';
@@ -1487,10 +1488,10 @@ sub test_DumpProg {
     utf8::encode($prog);
     
     if ( $test eq 'is' ) {
     utf8::encode($prog);
     
     if ( $test eq 'is' ) {
-        t::fresh_perl_is($prog . $u, $expected, undef, $name)
+        t::fresh_perl_is($prog . $u, $expected, $runperl_args, $name)
     }
     else {
     }
     else {
-        t::fresh_perl_like($prog . $u, $expected, undef, $name)
+        t::fresh_perl_like($prog . $u, $expected, $runperl_args, $name)
     }
 
     $builder->current_test(t::curr_test() - 1);
     }
 
     $builder->current_test(t::curr_test() - 1);