6 use Test::More tests => 2 * 5 + 1;
8 use Variable::Magic qw/cast/;
11 use Variable::Magic::TestWatcher;
13 my $wiz = init 'free', 'free';
15 my $n = int rand 1000;
19 check { cast $a, $wiz } { }, 'cast';
20 } { free => 1 }, 'deletion at the end of the scope';
23 check { cast $a, $wiz } { }, 'cast 2';
24 check { undef $a } { }, 'explicit deletion with undef()';
26 $Variable::Magic::TestWatcher::mg_end = { free => 1 };