X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-hash.t;fp=t%2F20-hash.t;h=867152a2f84dbd82f71618140938d3df47c3452f;hb=ddbfd527f4c54458985145aae3a837a8f5868551;hp=c4fb680acad1c7a6d1c187add88793228ea9f669;hpb=c242fc0347a4f52619f45807965c56a25db82cbd;p=perl%2Fmodules%2Fautovivification.git diff --git a/t/20-hash.t b/t/20-hash.t index c4fb680..867152a 100644 --- a/t/20-hash.t +++ b/t/20-hash.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 6 * 3 * 240; +use Test::More tests => 6 * 3 * 260; sub testcase { my ($var, $init, $code, $exp, $use, $global) = @_; @@ -148,6 +148,31 @@ $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1, { a => { b => 1 } } $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } } # +strict +store $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +strict +store +--- aliasing --- + +$x # 1 for $x->{a}; () # '', undef, { a => undef } +$x # 1 for $x->{a}; () # '', undef, undef # +$x # 1 for $x->{a}; () # '', undef, undef # +fetch +$x # 1 for $x->{a}; () # '', undef, { a => undef } # +exists +$x # 1 for $x->{a}; () # '', undef, { a => undef } # +delete +$x # 1 for $x->{a}; () # '', undef, { a => undef } # +store + +$x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } +$x # $_ = 1 for $x->{a}; () # '', undef, undef # +$x # $_ = 1 for $x->{a}; () # '', undef, undef # +fetch +$x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } # +exists +$x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } # +delete +$x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } # +store + +$x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 } # +fetch +$x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +fetch +$x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 } # +exists +$x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +exists +$x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 } # +delete +$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 + --- exists --- $x # exists $x->{a} # '', '', { }