X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F21-array.t;h=bf843d6e3f02b645bafa2b7c13b429b99354d8ad;hb=7b43fe3caca2977c57aea3f812131d16378cab46;hp=ed746c67f208bf466467691a907591e9dca10196;hpb=0c37aa6a52c733eb61895b9c95054e5e2f689ede;p=perl%2Fmodules%2Fautovivification.git diff --git a/t/21-array.t b/t/21-array.t index ed746c6..bf843d6 100644 --- a/t/21-array.t +++ b/t/21-array.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 6 * 3 * 260; +use Test::More tests => 6 * 3 * 270; use lib 't/lib'; use autovivification::TestCases; @@ -111,6 +111,20 @@ $x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +delete $x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +store $x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +store +--- dereferencing --- + +$x # no warnings 'uninitialized'; my @a = @$x; () # ($strict ? qr/Can't use an undefined value as an ARRAY reference/ : ''), undef, undef +$x # no warnings 'uninitialized'; my @a = @$x; () # ($strict ? qr/Can't use an undefined value as an ARRAY reference/ : ''), undef, undef # +$x # no warnings 'uninitialized'; my @a = @$x; () # ($strict ? qr/Can't use an undefined value as an ARRAY reference/ : ''), undef, undef # +fetch +$x # no warnings 'uninitialized'; my @a = @$x; () # ($strict ? qr/Can't use an undefined value as an ARRAY reference/ : ''), undef, undef # +exists +$x # no warnings 'uninitialized'; my @a = @$x; () # ($strict ? qr/Can't use an undefined value as an ARRAY reference/ : ''), undef, undef # +delete +$x # no warnings 'uninitialized'; my @a = @$x; () # ($strict ? qr/Can't use an undefined value as an ARRAY reference/ : ''), undef, undef # +store + +$x->[0] = 1 # my @a = @$x; () # '', undef, [ 1 ] # +fetch +$x->[0] = 1 # my @a = @$x; () # '', undef, [ 1 ] # +exists +$x->[0] = 1 # my @a = @$x; () # '', undef, [ 1 ] # +delete +$x->[0] = 1 # my @a = @$x; () # '', undef, [ 1 ] # +store + --- exists --- $x # exists $x->[0] # '', '', [ ]