3 use Test::More tests => 12;
5 use Variable::Magic qw/wizard gensig getsig cast dispell/;
9 my $wiz = eval { wizard sig => $sig };
10 ok(!$@, "wizard creation error ($@)");
11 ok(defined $wiz, 'wizard is defined');
12 ok(ref $wiz eq 'SCALAR', 'wizard is a scalar ref');
13 ok($sig == getsig $wiz, 'wizard signature is correct');
16 my $res = eval { cast $a, $wiz };
17 ok(!$@, "cast error 1 ($@)");
18 ok($res, 'cast error 2');
20 $res = eval { dispell $a, $wiz };
21 ok(!$@, "dispell from wizard error 1 ($@)");
22 ok($res, 'dispell from wizard error 2');
24 $res = eval { cast $a, $wiz };
25 ok(!$@, "re-cast error 1 ($@)");
26 ok($res, 're-cast error 2');
28 $res = eval { dispell $a, $sig };
29 ok(!$@, "dispell from signature error 1 ($@)");
30 ok($res, 'dispell from signature error 2');