X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F17-ctl.t;h=2adf60de8a858301b17a5fe621cb35163e1d906b;hb=d86c036207e622521bd725d7be7829d55ffd71f3;hp=ca22761333c3a5e5959aaddd4d6fb50a1af1d2d0;hpb=b30ad18085c2c1d922eff05ee4801c38ad465807;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/17-ctl.t b/t/17-ctl.t index ca22761..2adf60d 100644 --- a/t/17-ctl.t +++ b/t/17-ctl.t @@ -216,9 +216,10 @@ like $@, expect('tomato', undef, "\nBEGIN.*"), sub run_perl { my $code = shift; - my $SystemRoot = $ENV{SystemRoot}; + my ($SystemRoot, $PATH) = @ENV{qw}; local %ENV; $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot; + $ENV{PATH} = $PATH if $^O eq 'cygwin' and defined $PATH; system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code; } @@ -265,16 +266,10 @@ SKIP: skip 'No working Capture::Tiny is installed'=> $count unless $has_capture_tiny; my $output = Capture::Tiny::capture_merged(sub { run_perl <<' CODE' }); -use Variable::Magic qw; BEGIN { cast %::, wizard fetch => sub { die q[salsify] } } hlagh() +use Variable::Magic qw; BEGIN { cast %derp::, wizard fetch => sub { die q[raddish] } } derp::hlagh() CODE skip 'Test code didn\'t run properly' => $count unless defined $output; - my $suffix = "\nExecution(?s:.*)"; - if ("$]" >= 5.011005) { - $suffix = "(?:\nsalsify at -e line \\d+.){12}" . $suffix; - } elsif ("$]" >= 5.011) { - $suffix = "(?:\nsalsify at -e line \\d+.){3}" . $suffix; - } - like $output, expect('salsify', '-e', $suffix), - 'die in free callback at compile time and not in eval string'; + like $output, expect('raddish', '-e', "\nExecution(?s:.*)"), + 'die in free callback at compile time and not in eval string'; --$count; }