]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/20-get.t
Rename test functions init() and check() to init_watcher() and watch()
[perl/modules/Variable-Magic.git] / t / 20-get.t
index a308df598ddbadafc4bcfea44add9d89a51f5a88..7548e15e20adfef567fac84fa407063e64755b00 100644 (file)
@@ -10,15 +10,17 @@ use Variable::Magic qw/cast/;
 use lib 't/lib';
 use Variable::Magic::TestWatcher;
 
-my $wiz = init 'get', 'get';
+my $wiz = init_watcher 'get', 'get';
 
 my $n = int rand 1000;
 my $a = $n;
 
-check { cast $a, $wiz } { }, 'cast';
+watch { cast $a, $wiz } { }, 'cast';
 
-my $b = check { $a } { get => 1 }, 'assign to';
+my $b;
+# $b has to be set inside the block for the test to pass on 5.8.3 and lower
+watch { $b = $a } { get => 1 }, 'assign to';
 is $b, $n, 'get: assign to correctly';
 
-$b = check { "X${a}Y" } { get => 1 }, 'interpolate';
+$b = watch { "X${a}Y" } { get => 1 }, 'interpolate';
 is $b, "X${n}Y", 'get: interpolate correctly';