X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F17-ctl.t;h=ef1be224438280d5825de3fc9b8df7b002252d66;hb=78d307d30a1fa82e6b8e7ba95c617d9b87eb4d45;hp=38924d6f89f8e9505261e3aa80f948f9776ee83f;hpb=2b43040992d1105e0cb8e0aee5a5e9f3b6c58dd8;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/17-ctl.t b/t/17-ctl.t index 38924d6..ef1be22 100644 --- a/t/17-ctl.t +++ b/t/17-ctl.t @@ -5,7 +5,7 @@ use warnings; use Test::More tests => 4 * 8 + 10 + 1 + 1; -use Variable::Magic qw/wizard cast VMG_UVAR/; +use Variable::Magic qw; sub expect { my ($name, $where, $suffix) = @_; @@ -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; } @@ -247,7 +248,7 @@ 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/wizard cast/; { BEGIN { $^H |= 0x020000; cast %^H, wizard free => sub { die q[cucumber] } } } +use Variable::Magic qw; { BEGIN { $^H |= 0x020000; cast %^H, wizard free => sub { die q[cucumber] } } } CODE skip 'Test code didn\'t run properly' => $count unless defined $output; like $output, expect('cucumber', '-e', "\nExecution(?s:.*)"), @@ -265,13 +266,15 @@ 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/wizard cast/; BEGIN { cast %::, wizard fetch => sub { die q[salsify] } } hlagh() +use Variable::Magic qw; BEGIN { cast %::, wizard fetch => sub { die q[salsify] } } hlagh() CODE skip 'Test code didn\'t run properly' => $count unless defined $output; my $suffix = "\nExecution(?s:.*)"; - if ($] >= 5.011005) { + if ("$]" >= 5.017) { + $suffix = "(?:\nsalsify at -e line \\d+.){16}" . $suffix; + } elsif ("$]" >= 5.011_005) { $suffix = "(?:\nsalsify at -e line \\d+.){12}" . $suffix; - } elsif ($] >= 5.011) { + } elsif ("$]" >= 5.011) { $suffix = "(?:\nsalsify at -e line \\d+.){3}" . $suffix; } like $output, expect('salsify', '-e', $suffix),