]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - t/21-array.t
Don't vivify when aliasing
[perl/modules/autovivification.git] / t / 21-array.t
index 95bb8ff5bfea843030820ab04dcc5dc9df2e8dea..dae28a42d16f04dcd3d609a49e43439b76611b39 100644 (file)
@@ -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->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +store
 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +store 
 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +strict +store 
  
+--- aliasing --- 
+$x # 1 for $x->[0]; () # '', undef, [ undef ] 
+$x # 1 for $x->[0]; () # '', undef, undef # 
+$x # 1 for $x->[0]; () # '', undef, undef # +fetch 
+$x # 1 for $x->[0]; () # '', undef, [ undef ] # +exists 
+$x # 1 for $x->[0]; () # '', undef, [ undef ] # +delete 
+$x # 1 for $x->[0]; () # '', undef, [ undef ] # +store 
+$x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] 
+$x # $_ = 1 for $x->[0]; () # '', undef, undef # 
+$x # $_ = 1 for $x->[0]; () # '', undef, undef # +fetch 
+$x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] # +exists 
+$x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] # +delete 
+$x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] # +store 
+$x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +fetch 
+$x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +fetch 
+$x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +exists 
+$x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +exists 
+$x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +delete 
+$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 
 --- exists --- 
  
 $x # exists $x->[0] # '', '', [ ]