]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - t/21-array.t
Plain dereferencing shouldn't have a different behaviour
[perl/modules/autovivification.git] / t / 21-array.t
index ed746c67f208bf466467691a907591e9dca10196..bf843d6e3f02b645bafa2b7c13b429b99354d8ad 100644 (file)
@@ -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] # '', '', [ ]