From: Vincent Pit Date: Fri, 23 Jan 2009 00:23:14 +0000 (+0100) Subject: Reenable copy tests in t/32-hash.t as they are not the issue X-Git-Tag: v0.28~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=85d3a6385550ebc09bb317945213cbb960973c4f;p=perl%2Fmodules%2FVariable-Magic.git Reenable copy tests in t/32-hash.t as they are not the issue --- diff --git a/t/32-hash.t b/t/32-hash.t index 4686d27..c2697d5 100644 --- a/t/32-hash.t +++ b/t/32-hash.t @@ -11,7 +11,7 @@ use lib 't/lib'; use Variable::Magic::TestWatcher; my $wiz = init - [ qw/get set len free dup local fetch store exists delete/ ], # clear copy + [ qw/get set len free copy dup local fetch store exists delete/ ], # clear 'hash'; my %n = map { $_ => int rand 1000 } qw/foo bar baz qux/; @@ -40,20 +40,17 @@ is_deeply \@b, [ @n{qw/bar qux/} ], 'hash: slice correctly'; check { %h = () } { }, 'empty in list context'; # clear => 1 check { %h = (a => 1, d => 3); () } - +{ (store => 2) x VMG_UVAR }, - # clear => 1, (copy => 2) x VMG_UVAR + +{ (store => 2, copy => 2) x VMG_UVAR }, # clear => 1 'assign from list in void context'; check { %h = map { $_ => 1 } qw/a b d/; } - +{ (exists => 3, store => 3) x VMG_UVAR }, - # clear => 1, (copy => 3) x VMG_UVAR + +{ (exists => 3, store => 3, copy => 3) x VMG_UVAR }, # clear =>1 'assign from map in list context'; check { $h{d} = 2; () } +{ (store => 1) x VMG_UVAR }, 'assign old element'; -check { $h{c} = 3; () } +{ (store => 1) x VMG_UVAR }, - # (copy => 1) x VMG_UVAR # maybe also if clear magic +check { $h{c} = 3; () } +{ (store => 1, copy => 1) x VMG_UVAR }, 'assign new element'; check { $s = %h } { }, 'buckets';