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