X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F55-yield-target.t;h=ced05c8bbcdca6c6d7fb5ed9b80b887420210d07;hb=8aa5517d42b61e877ca7e4198f12ab879fa8218b;hp=48b503626157e7eecc080ff2b6b5b33c61adb80b;hpb=be1d59463692da1b5ef787aeffd0aedbef65664e;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/55-yield-target.t b/t/55-yield-target.t index 48b5036..ced05c8 100644 --- a/t/55-yield-target.t +++ b/t/55-yield-target.t @@ -63,7 +63,9 @@ is_deeply \@res, [ 15, 19 ], 'yield() in for () { ... }'; is $loop, 21, 'yield() exited while'; is_deeply \@res, [ 20, 23 ], 'yield() in while () { ... }'; -{ +SKIP: { + skip '"eval { $str =~ s/./die q[foo]/e }" breaks havoc on perl 5.8 and below' + => 1 if "$]" < 5.010; my $s = 'a'; local $@; eval { @@ -72,7 +74,7 @@ is_deeply \@res, [ 20, 23 ], 'yield() in while () { ... }'; my $err = $@; my $line = __LINE__-3; like $err, - qr/^yield\(\) cannot target a substitution context at \Q$0\E line $line/, + qr/^yield\(\) can't target a substitution context at \Q$0\E line $line/, 'yield() cannot exit subst'; } @@ -81,6 +83,12 @@ SKIP: { if "$]" < 5.010; @res = eval <<'TESTCASE'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; (24, do { given (25) { @@ -96,6 +104,12 @@ TESTCASE # end of the enclosing given block. @res = (); eval <<'TESTCASE'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; @res = (28, do { given (29) { @@ -113,6 +127,12 @@ TESTCASE # But calling yield() in when() in for() sends us at the next iteration. @res = (); eval <<'TESTCASE'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; @res = (31, do { for (32, 33) {