6 use Test::More tests => 2 * 4 + 2 + 1;
8 use Variable::Magic qw/cast/;
11 use Variable::Magic::TestWatcher;
13 my $wiz = init 'get', 'get';
15 my $n = int rand 1000;
18 check { cast $a, $wiz } { }, 'cast';
21 # $b has to be set inside the block for the test to pass on 5.8.3 and lower
22 check { $b = $a } { get => 1 }, 'assign to';
23 is $b, $n, 'get: assign to correctly';
25 $b = check { "X${a}Y" } { get => 1 }, 'interpolate';
26 is $b, "X${n}Y", 'get: interpolate correctly';