From: Vincent Pit Date: Wed, 17 Jun 2009 14:12:56 +0000 (+0200) Subject: Test keys/values on true references X-Git-Tag: v0.02~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=54c73ca86bbd7cbe8f2ddec71bb74571b4675ef7;p=perl%2Fmodules%2Fautovivification.git Test keys/values on true references --- diff --git a/t/23-hash-specific.t b/t/23-hash-specific.t index d3ebe05..47c7b41 100644 --- a/t/23-hash-specific.t +++ b/t/23-hash-specific.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 6 * 3 * 56; +use Test::More tests => 6 * 3 * 64; use lib 't/lib'; use autovivification::TestCases; @@ -35,6 +35,11 @@ $x # [ keys %$x ] # '', [ ], undef # $x # [ keys %$x ] # '', [ ], undef # +fetch $x # [ keys %$x ] # '', [ ], { } # +exists +delete +store +$x->{a} ='b' # [ keys %$x ] # '', [ 'a' ], { a => 'b' } +$x->{a} ='b' # [ keys %$x ] # '', [ 'a' ], { a => 'b' } # +$x->{a} ='b' # [ keys %$x ] # '', [ 'a' ], { a => 'b' } # +fetch +$x->{a} ='b' # [ keys %$x ] # '', [ 'a' ], { a => 'b' } # +exists +delete +store + $x # keys %{$x->{a}} # '', 0, { a => { } } $x # keys %{$x->{a}} # '', 0, undef # $x # keys %{$x->{a}} # '', 0, undef # +fetch @@ -71,6 +76,11 @@ $x # [ values %$x ] # '', [ ], undef # $x # [ values %$x ] # '', [ ], undef # +fetch $x # [ values %$x ] # '', [ ], { } # +exists +delete +store +$x->{a} ='b' # [ values %$x ] # '', [ 'b' ], { a=>'b' } +$x->{a} ='b' # [ values %$x ] # '', [ 'b' ], { a=>'b' } # +$x->{a} ='b' # [ values %$x ] # '', [ 'b' ], { a=>'b' } # +fetch +$x->{a} ='b' # [ values %$x ] # '', [ 'b' ], { a=>'b' } # +exists +delete +store + $x # values %{$x->{a}} # '', 0, { a => { } } $x # values %{$x->{a}} # '', 0, undef # $x # values %{$x->{a}} # '', 0, undef # +fetch