6 use Test::More tests => (2 * 4 + 2) + (2 * 2) + 1;
8 use Variable::Magic qw<cast>;
11 use Variable::Magic::TestWatcher;
12 use Variable::Magic::TestValue;
14 my $wiz = init_watcher 'get', 'get';
16 my $n = int rand 1000;
19 watch { cast $a, $wiz } { }, 'cast';
22 # $b has to be set inside the block for the test to pass on 5.8.3 and lower
23 watch { $b = $a } { get => 1 }, 'assign to';
24 is $b, $n, 'get: assign to correctly';
26 $b = watch { "X${a}Y" } { get => 1 }, 'interpolate';
27 is $b, "X${n}Y", 'get: interpolate correctly';
32 init_value $val, 'get', 'get';
34 value { my $x = $val } \0;