X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F13-reap-ctl.t;h=d7a7f14057f84c11463bd544ed0154e02bc75bae;hb=c8fb3ada01d8c1a6ac1a37778edb0fc9164d7bf1;hp=6208642a9ccd595ef03a10d38b21dbb58c49bedf;hpb=e26cff534d772ff66c0cdf5761787f43c6b7c5ec;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/13-reap-ctl.t b/t/13-reap-ctl.t index 6208642..d7a7f14 100644 --- a/t/13-reap-ctl.t +++ b/t/13-reap-ctl.t @@ -138,8 +138,16 @@ $y = undef; SKIP: { skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010; + skip 'Not testing deprecated given/when on Perl 5.37.10 or later' + => 30 if "$]" >= 5.037010; eval <<' GIVEN_TEST_1'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; local $y; { @@ -161,6 +169,12 @@ SKIP: fail $@ if $@; eval <<' GIVEN_TEST_2'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; local $y; { @@ -184,6 +198,12 @@ SKIP: fail $@ if $@; eval <<' GIVEN_TEST_3'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; local $y; { @@ -205,6 +225,12 @@ SKIP: fail $@ if $@; eval <<' GIVEN_TEST_4'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; local $y; { @@ -228,6 +254,12 @@ SKIP: fail $@ if $@; eval <<' GIVEN_TEST_5'; + BEGIN { + if ("$]" >= 5.017_011) { + require warnings; + warnings->unimport('experimental::smartmatch'); + } + } use feature 'switch'; local $y; { @@ -272,10 +304,12 @@ $y = undef; reap { ++$y; die "reaped\n" } => HERE; is $x, 3, 'die in reap at eval [not yet - x]'; is $y, undef, 'die in reap at eval [not yet - y]'; - }; # should trigger here, but the die isn't catched by this eval - die "failed\n"; + }; # should trigger here, but the die isn't catched by this eval in + # ealier perls + die "inner\n"; }; - is $@, "reaped\n", 'die in reap at eval [ok - $@]'; + is $@, ($] >= 5.023008 ? "inner\n" : "reaped\n"), + 'die in reap at eval [ok - $@]'; is $x, 1, 'die in reap at eval [ok - x]'; is $y, 1, 'die in reap at eval [ok - y]'; }