X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F80-leaks.t;fp=t%2F80-leaks.t;h=647419f01d6b9ec722984719f7824938a40c7d44;hb=4a23afbd13837f7054d2d5e206d207b44cef9e3a;hp=0d4075302d0e0a6cfac6457f55a58bb086fe066c;hpb=095bd378aa643e565628144e0a28d31579fab579;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/80-leaks.t b/t/80-leaks.t index 0d40753..647419f 100644 --- a/t/80-leaks.t +++ b/t/80-leaks.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 11; use Variable::Magic qw/wizard cast getdata/; @@ -65,3 +65,27 @@ sub D () { 'Variable::Magic::TestDestructor' } is $destroyed, 1; } + +{ + local $destroyed = 0; + + { + my $obj = D->new; + + { + my $w = wizard set => $obj; + + { + my $x = 1; + cast $x, $w; + is $destroyed, 0; + } + + is $destroyed, 0; + } + + is $destroyed, 0; + } + + is $destroyed, 1; +}