X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F80-leaks.t;h=7b2a3f0ed51d44ec3ddd9d6a693104cb907a1b8e;hb=bd7cdd0635d30485b50564b9eebb2d73b3c0f94b;hp=0d4075302d0e0a6cfac6457f55a58bb086fe066c;hpb=095bd378aa643e565628144e0a28d31579fab579;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/80-leaks.t b/t/80-leaks.t index 0d40753..7b2a3f0 100644 --- a/t/80-leaks.t +++ b/t/80-leaks.t @@ -3,9 +3,9 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 11; -use Variable::Magic qw/wizard cast getdata/; +use Variable::Magic qw; our $destroyed; @@ -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; +}