X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F15-self.t;h=a9560ab52230a53a9140e336bfddb571612838d7;hb=ecc16f5aeded896b3ab1f0019fc489bb5e15bc08;hp=0550dc4adae5fe7927b49ed9bd1935123e70196a;hpb=7f3b1ec01ca3856b1d5670ab9795cf0e91ba8928;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/15-self.t b/t/15-self.t index 0550dc4..a9560ab 100644 --- a/t/15-self.t +++ b/t/15-self.t @@ -1,4 +1,4 @@ -#!perl -T +#!perl use strict; use warnings; @@ -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; }