X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F31-array-fast.t;h=6f620407922dbbce6563f07c048efc9c90941171;hb=c1151a562c1a34879faa026fb49284057d0f7670;hp=2930304683b5f42810e973916550222eecd4a031;hpb=f46c60eca42ac927f26e0d332112a3a5eae80269;p=perl%2Fmodules%2Fautovivification.git diff --git a/t/31-array-fast.t b/t/31-array-fast.t index 2930304..6f62040 100644 --- a/t/31-array-fast.t +++ b/t/31-array-fast.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 6 * 3 * 274; +use Test::More tests => 9 * 3 * 290; use lib 't/lib'; use autovivification::TestCases; @@ -130,6 +130,28 @@ $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 +--- slice --- + +$x # my @a = @$x[0, 1]; \@a # '', [ undef, undef ], [ ] +$x # my @a = @$x[0, 1]; \@a # '', [ undef, undef ], undef # +$x # my @a = @$x[0, 1]; \@a # '', [ undef, undef ], undef # +fetch +$x # my @a = @$x[0, 1]; \@a # '', [ undef, undef ], [ ] # +exists +$x # my @a = @$x[0, 1]; \@a # '', [ undef, undef ], [ ] # +delete +$x # my @a = @$x[0, 1]; \@a # '', [ undef, undef ], [ ] # +store + +$x->[1] = 0 # my @a = @$x[0, 1]; \@a # '', [ undef, 0 ], [ undef, 0 ] # +fetch + +$x # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] +$x # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] # +$x # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] # +fetch +$x # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] # +exists +$x # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] # +delete +$x # @$x[0, 1] = (1, 2); () # qr/^Can't vivify reference/, undef, undef # +store + +$x->[0] = 0 # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] # +store +$x->[2] = 0 # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2, 0 ] # +store +$x->[0] = 0, $x->[1] = 0 # @$x[0, 1] = (1, 2); () # '', undef, [ 1, 2 ] # +store + --- exists --- $x # exists $x->[0] # '', '', [ ]