- for (0 .. 3) { return 0 unless $c[$_] == $x[$_]; }
- return 1;
+ is join(':', map { (defined) ? $_ : 'u' } @c[0 .. 3]),
+ join(':', map { (defined) ? $_ : 'u' } @x[0 .. 3]),
+ $_[0];
}
my $wiz = wizard 'fetch' => sub { ++$c[0] },
'store' => sub { ++$c[1] },
'exists' => sub { ++$c[2] },
'delete' => sub { ++$c[3] };
}
my $wiz = wizard 'fetch' => sub { ++$c[0] },
'store' => sub { ++$c[1] },
'exists' => sub { ++$c[2] },
'delete' => sub { ++$c[3] };
-ok($res, 'uvar : cast succeeded');
-ok(check(), 'uvar : cast didn\'t triggered the callback');
+ok($res, 'uvar : cast succeeded');
+check( 'uvar : cast didn\'t triggered the callback');
-ok(check(), 'uvar : fetch directly');
-ok($x, 'uvar : fetch directly correctly');
+check( 'uvar : fetch directly');
+ok($x, 'uvar : fetch directly correctly');
-ok(check(), 'uvar : fetch by interpolation');
-ok($x == 2, 'uvar : fetch by interpolation correctly');
+check( 'uvar : fetch by interpolation');
+is($x, 2, 'uvar : fetch by interpolation correctly');
-ok(check(), 'uvar : fetch and store');
-ok($x == 5, 'uvar : fetch and store correctly');
+check( 'uvar : fetch and store');
+is($x, 5, 'uvar : fetch and store correctly');
-ok(check(), 'uvar : exists');
-ok($x, 'uvar : exists correctly');
+check( 'uvar : exists');
+ok($x, 'uvar : exists correctly');
-ok(check(), 'uvar : delete existing key');
-ok($x == 5, 'uvar : delete existing key correctly');
+check( 'uvar : delete existing key');
+is($x, 5, 'uvar : delete existing key correctly');
ok(!defined $x, 'uvar : delete non-existing key correctly');
my $wiz2 = wizard 'fetch' => sub { 0 };
ok(!defined $x, 'uvar : delete non-existing key correctly');
my $wiz2 = wizard 'fetch' => sub { 0 };
-ok(!$@, 'uvar : fetch with incomplete magic');
-ok($x == 37, 'uvar : fetch with incomplete magic correctly');
+ok(!$@, 'uvar : fetch with incomplete magic');
+is($x, 37, 'uvar : fetch with incomplete magic correctly');
-ok(!$@, 'uvar : store with incomplete magic');
-ok($h2{a} == 73, 'uvar : store with incomplete magic correctly');
+ok(!$@, 'uvar : store with incomplete magic');
+is($h2{a}, 73, 'uvar : store with incomplete magic correctly');