From: Vincent Pit Date: Thu, 22 Jan 2009 23:46:19 +0000 (+0100) Subject: Test emptying a hash (can't believe this wasn't already tested) X-Git-Tag: v0.28~12 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=997fe5643a5c203315ff26f4e4bf7840fb33a9d8;p=perl%2Fmodules%2FVariable-Magic.git Test emptying a hash (can't believe this wasn't already tested) --- diff --git a/t/32-hash.t b/t/32-hash.t index d04c366..4686d27 100644 --- a/t/32-hash.t +++ b/t/32-hash.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 2 * 18 + 5 + 1; +use Test::More tests => 2 * 19 + 5 + 1; use Variable::Magic qw/cast dispell MGf_COPY VMG_UVAR/; @@ -37,6 +37,8 @@ check { @b = @h{qw/bar qux/} } # (copy => 2) x MGf_COPY # if clear magic 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