X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F25-copy.t;fp=t%2F25-copy.t;h=63a5289aed048306f689094214744b55abc545a4;hb=c78c1790ebe43372ca405385d4cc053121b53ba0;hp=80b3bc95c5212ab1c3c2cd99d2e8cfbcaa5ab418;hpb=1b88e230428d6cc4f3ff364fbcfd7f5c1a40fedc;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/25-copy.t b/t/25-copy.t index 80b3bc9..63a5289 100644 --- a/t/25-copy.t +++ b/t/25-copy.t @@ -31,11 +31,10 @@ SKIP: { check { $a[3] = 13 } { copy => 1 }, 'tied array store'; - my $s; - check { $s = $a[3] } { copy => 1 }, 'tied array fetch'; + my $s = check { $a[3] } { copy => 1 }, 'tied array fetch'; is $s, 13, 'copy: tied array fetch correctly'; - check { $s = exists $a[3] } { copy => 1 }, 'tied array exists'; + $s = check { exists $a[3] } { copy => 1 }, 'tied array exists'; ok $s, 'copy: tied array exists correctly'; check { undef @a } { }, 'tied array undef'; @@ -54,24 +53,21 @@ SKIP: { check { $h{b} = 7 } { copy => 1 }, 'tied hash store'; - my $s; - check { $s = $h{c} } { copy => 1 }, 'tied hash fetch'; + my $s = check { $h{c} } { copy => 1 }, 'tied hash fetch'; is $s, 3, 'copy: tied hash fetch correctly'; - check { $s = exists $h{a} } { copy => 1 }, 'tied hash exists'; + $s = check { exists $h{a} } { copy => 1 }, 'tied hash exists'; ok $s, 'copy: tied hash exists correctly'; - check { $s = delete $h{b} } { copy => 1 }, 'tied hash delete'; + $s = check { delete $h{b} } { copy => 1 }, 'tied hash delete'; is $s, 7, 'copy: tied hash delete correctly'; check { my ($k, $v) = each %h } { copy => 1 }, 'tied hash each'; - my @k; - check { @k = keys %h } { }, 'tied hash keys'; + my @k = check { keys %h } { }, 'tied hash keys'; is_deeply [ sort @k ], [ qw/a c/ ], 'copy: tied hash keys correctly'; - my @v; - check { @v = values %h } { copy => 2 }, 'tied hash values'; + my @v = check { values %h } { copy => 2 }, 'tied hash values'; is_deeply [ sort { $a <=> $b } @v ], [ 1, 3 ], 'copy: tied hash values correctly'; check { undef %h } { }, 'tied hash undef';