6 use Test::More tests => 2 * 5 + 2 + 1;
8 use Variable::Magic qw/cast/;
11 use Variable::Magic::TestWatcher;
13 my $wiz = init 'clear', 'clear';
17 check { cast @a, $wiz } { }, 'cast array';
19 check { @a = () } { clear => 1 }, 'clear array';
20 is_deeply \@a, [ ], 'clear: clear array correctly';
22 my %h = (foo => 1, bar => 2);
24 check { cast %h, $wiz } { }, 'cast hash';
26 check { %h = () } { clear => 1 }, 'clear hash';
27 is_deeply \%h, { }, 'clear: clear hash correctly';