X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=blobdiff_plain;f=t%2F15-self.t;fp=t%2F15-self.t;h=a9560ab52230a53a9140e336bfddb571612838d7;hp=adc4ec7a59e9d056eb4da86b116ff9fc11892540;hb=ecc16f5aeded896b3ab1f0019fc489bb5e15bc08;hpb=2a7199760cc1080be8e62e425d74a85f4eebcdfc diff --git a/t/15-self.t b/t/15-self.t index adc4ec7..a9560ab 100644 --- a/t/15-self.t +++ b/t/15-self.t @@ -6,7 +6,7 @@ use warnings; use Test::More; my $tests; -BEGIN { $tests = 17 } +BEGIN { $tests = 18 } plan tests => $tests; @@ -183,6 +183,23 @@ my $c = 0; } } +SKIP: { + skip "Called twice starting from perl 5.24" => 1 if "$]" >= 5.024; + + my $recasted = 0; + + my $wiz2 = wizard; + my $wiz1 = wizard free => sub { ++$recasted; &cast($_[0], $wiz2); die 'xxx' }; + + local $@; + my $res = eval { + my $v = do { my $val = 123; \$val }; + &cast($v, $wiz1); + }; + + is $recasted, 1, 'recasting free callback called only once'; +} + eval q[ use lib 't/lib'; BEGIN { require Variable::Magic::TestDestroyRequired; }