6 use Test::More tests => 14;
8 use Variable::Magic qw/wizard cast dispell/;
14 is join(':', map { (defined) ? $_ : 'u' } @c[0 .. 11]),
15 join(':', map { (defined) ? $_ : 'u' } @x[0 .. 11]),
20 my $wiz = wizard get => sub { ++$c[0] },
21 set => sub { ++$c[1] },
22 len => sub { ++$c[2] },
23 clear => sub { ++$c[3] },
24 free => sub { ++$c[4] },
25 copy => sub { ++$c[5] },
26 dup => sub { ++$c[6] },
27 local => sub { ++$c[7] },
28 fetch => sub { ++$c[8] },
29 store => sub { ++$c[9] },
30 'exists' => sub { ++$c[10] },
31 'delete' => sub { ++$c[11] };
32 check('code : create wizard');
41 check('code : call without arguments');
42 is($x, 1, 'code : call without arguments succeeded');
45 check('code : call with arguments');
46 is($x, 2, 'code : call with arguments succeeded');
50 check('code : undef symbol table');
51 is($x, 2, 'code : undef symbol table didn\'t call');
54 *hlagh = sub { ++$y };
57 check('code : re-cast');
60 check('code : take reference');
63 check('code : call reference');
64 is($y, 1, 'code : call reference succeeded');
65 is($x, 2, 'code : call reference didn\'t triggered the previous code');
68 check('code : dispell');