X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-hash.t;h=30618340caec981dbd0db104bc8abfa933e16243;hb=0b4ae66b743ee623cdfdb7cdbea5c84338f9e3d9;hp=6438056f89dae2ea5cf53250540d8e86ed9ea824;hpb=68e31f8ce73ddedf82977b4e05ec550c1cfe5688;p=perl%2Fmodules%2Fautovivification.git diff --git a/t/20-hash.t b/t/20-hash.t index 6438056..3061834 100644 --- a/t/20-hash.t +++ b/t/20-hash.t @@ -3,9 +3,9 @@ use strict; use warnings; -use Test::More tests => 9 * 3 * 290; - use lib 't/lib'; +use Test::Leaner tests => 9 * 3 * 302; + use autovivification::TestCases; while () { @@ -116,6 +116,20 @@ $x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +delete $x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 } # +store $x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +store +$x # do_nothing($x->{a}); () # '', undef, { } +$x # do_nothing($x->{a}); () # '', undef, { } # +$x # do_nothing($x->{a}); () # '', undef, { } # +fetch +$x # do_nothing($x->{a}); () # '', undef, { } # +exists +$x # do_nothing($x->{a}); () # '', undef, { } # +delete +$x # do_nothing($x->{a}); () # qr/^Can't vivify reference/, undef, undef # +store + +$x # set_arg($x->{a}); () # '', undef, { a => 1 } +$x # set_arg($x->{a}); () # '', undef, { a => 1 } # +$x # set_arg($x->{a}); () # '', undef, { a => 1 } # +fetch +$x # set_arg($x->{a}); () # '', undef, { a => 1 } # +exists +$x # set_arg($x->{a}); () # '', undef, { a => 1 } # +delete +$x # set_arg($x->{a}); () # qr/^Can't vivify reference/, undef, undef # +store + --- dereferencing --- $x # no warnings 'uninitialized'; my @a = %$x; () # ($strict ? qr/^Can't use an undefined value as a HASH reference/ : ''), undef, undef