6 use Test::More tests => (2 * 5 + 3) + (2 * 2 + 1);
8 use Variable::Magic qw<cast>;
11 use Variable::Magic::TestWatcher;
12 use Variable::Magic::TestValue;
14 my $wiz = init_watcher 'set', 'set';
18 watch { cast $a, $wiz } { }, 'cast';
20 my $n = int rand 1000;
22 watch { $a = $n } { set => 1 }, 'assign';
23 is $a, $n, 'set: assign correctly';
25 watch { ++$a } { set => 1 }, 'increment';
26 is $a, $n + 1, 'set: increment correctly';
28 watch { --$a } { set => 1 }, 'decrement';
29 is $a, $n, 'set: decrement correctly';
34 init_value $val, 'set', 'set';
36 value { $val = 1 } \1;