]> git.vpit.fr Git - perl/modules/autovivification.git/blob - t/21-array.t
Regenerate t/21-array.t without extraneous spaces at the end of each line
[perl/modules/autovivification.git] / t / 21-array.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 6 * 3 * 260;
7
8 sub testcase {
9  my ($var, $init, $code, $exp, $use, $global) = @_;
10  my $decl = $global ? "our $var; local $var;" : "my $var;";
11  my $test = $var =~ /^[@%]/ ? "\\$var" : $var;
12  return <<TESTCASE;
13 my \@exp = ($exp);
14 $decl
15 $init
16 my \$res = eval {
17  local \$SIG{__WARN__} = sub { die join '', 'warn:', \@_ };
18  $use
19  $code
20 };
21 if (ref \$exp[0]) {
22  like \$@, \$exp[0], \$desc . ' [exception]';
23 } else {
24  is   \$@, \$exp[0], \$desc . ' [exception]';
25 }
26 is_deeply \$res, \$exp[1], \$desc . ' [return]';
27 is_deeply $test, \$exp[2], \$desc . ' [variable]';
28 TESTCASE
29 }
30
31 while (<DATA>) {
32  1 while chomp;
33  next unless /#/;
34  my @chunks = split /#+/, "$_ ";
35  s/^\s+//, s/\s+$// for @chunks;
36  my ($init, $code, $exp, $opts) = @chunks;
37  (my $var = $init) =~ s/[^\$@%\w].*//;
38  $init = $var eq $init ? '' : "$init;";
39  my $use;
40  if ($opts) {
41   for (split ' ', $opts) {
42    my $no = 1;
43    $no = 0 if s/^([-+])// and $1 eq '-';
44    $use .= ($no ? 'no' : 'use') . " autovivification '$_';"
45   }
46  } elsif (defined $opts) {
47   $opts = 'empty';
48   $use  = 'no autovivification;';
49  } else {
50   $opts = 'default';
51   $use  = '';
52  }
53  my @testcases = (
54   [ $var, $init,               $code, $exp, $use, 0 ],
55   [ $var, "use strict; $init", $code, $exp, $use, 1 ],
56   [ $var, "no strict;  $init", $code, $exp, $use, 1 ],
57  );
58  my @extra;
59  for (@testcases) {
60   my $var = $_->[0];
61   if ($var =~ /\$/) {
62    my @new = @$_;
63    $new[0] =~ s/^$/@/;
64    $new[1] =~ s/$var\->/$var/g;
65    $new[2] =~ s/$var\->/$var/g;
66    push @extra, \@new;
67   }
68  }
69  push @testcases, @extra;
70  for (@testcases) {
71   my $testcase = testcase(@$_);
72   my ($var, $init, $code) = @$_;
73   my $desc = do { (my $x = "$var | $init") =~ s,;\s+$,,; $x } . " | $code | $opts";
74   eval $testcase;
75   diag "== This testcase failed to compile ==\n$testcase\n## Reason: $@" if $@;
76  }
77 }
78
79 __DATA__
80
81 --- fetch ---
82
83 $x # $x->[0] # '', undef, [ ]
84 $x # $x->[0] # '', undef, undef #
85 $x # $x->[0] # '', undef, undef # +fetch
86 $x # $x->[0] # '', undef, [ ] # +exists
87 $x # $x->[0] # '', undef, [ ] # +delete
88 $x # $x->[0] # '', undef, [ ] # +store
89
90 $x # $x->[0] # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
91 $x # $x->[0] # '', undef, [ ] # +strict +exists
92 $x # $x->[0] # '', undef, [ ] # +strict +delete
93 $x # $x->[0] # '', undef, [ ] # +strict +store
94
95 $x # $x->[0]->[1] # '', undef, [ [ ] ]
96 $x # $x->[0]->[1] # '', undef, undef #
97 $x # $x->[0]->[1] # '', undef, undef # +fetch
98 $x # $x->[0]->[1] # '', undef, [ [ ] ] # +exists
99 $x # $x->[0]->[1] # '', undef, [ [ ] ] # +delete
100 $x # $x->[0]->[1] # '', undef, [ [ ] ] # +store
101
102 $x # $x->[0]->[1] # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
103 $x # $x->[0]->[1] # '', undef, [ [ ] ] # +strict +exists
104 $x # $x->[0]->[1] # '', undef, [ [ ] ] # +strict +delete
105 $x # $x->[0]->[1] # '', undef, [ [ ] ] # +strict +store
106
107 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +fetch
108 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +fetch
109 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +exists
110 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +exists
111 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +delete
112 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +delete
113 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +store
114 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +store
115
116 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +strict +fetch
117 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +strict +fetch
118 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +strict +exists
119 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +strict +exists
120 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +strict +delete
121 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +strict +delete
122 $x->[0] = 1 # $x->[0] # '', 1, [ 1 ] # +strict +store
123 $x->[0] = 1 # $x->[1] # '', undef, [ 1 ] # +strict +store
124
125 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +fetch
126 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +fetch
127 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ] ] # +fetch
128 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +exists
129 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +exists
130 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +exists
131 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +delete
132 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +delete
133 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +delete
134 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +store
135 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +store
136 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +store
137
138 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +fetch
139 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +fetch
140 $x->[0]->[1] = 1 # $x->[2]->[3] # qr/^Reference vivification forbidden/, undef, [ [ undef, 1 ] ] # +strict +fetch
141 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +exists
142 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +exists
143 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +strict +exists
144 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +delete
145 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +delete
146 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +strict +delete
147 $x->[0]->[1] = 1 # $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +store
148 $x->[0]->[1] = 1 # $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +store
149 $x->[0]->[1] = 1 # $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +strict +store
150
151 --- aliasing ---
152
153 $x # 1 for $x->[0]; () # '', undef, [ undef ]
154 $x # 1 for $x->[0]; () # '', undef, undef #
155 $x # 1 for $x->[0]; () # '', undef, undef # +fetch
156 $x # 1 for $x->[0]; () # '', undef, [ undef ] # +exists
157 $x # 1 for $x->[0]; () # '', undef, [ undef ] # +delete
158 $x # 1 for $x->[0]; () # '', undef, [ undef ] # +store
159
160 $x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ]
161 $x # $_ = 1 for $x->[0]; () # '', undef, undef #
162 $x # $_ = 1 for $x->[0]; () # '', undef, undef # +fetch
163 $x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] # +exists
164 $x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] # +delete
165 $x # $_ = 1 for $x->[0]; () # '', undef, [ 1 ] # +store
166
167 $x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +fetch
168 $x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +fetch
169 $x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +exists
170 $x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +exists
171 $x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +delete
172 $x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +delete
173 $x->[0] = 1 # 1 for $x->[0]; () # '', undef, [ 1 ] # +store
174 $x->[0] = 1 # 1 for $x->[1]; () # '', undef, [ 1, undef ] # +store
175
176 --- exists ---
177
178 $x # exists $x->[0] # '', '', [ ]
179 $x # exists $x->[0] # '', '', undef #
180 $x # exists $x->[0] # '', '', [ ] # +fetch
181 $x # exists $x->[0] # '', '', undef # +exists
182 $x # exists $x->[0] # '', '', [ ] # +delete
183 $x # exists $x->[0] # '', '', [ ] # +store
184
185 $x # exists $x->[0] # '', '', [ ] # +strict +fetch
186 $x # exists $x->[0] # qr/^Reference vivification forbidden/, undef, undef # +strict +exists
187 $x # exists $x->[0] # '', '', [ ] # +strict +delete
188 $x # exists $x->[0] # '', '', [ ] # +strict +store
189
190 $x # exists $x->[0]->[1] # '', '', [ [ ] ]
191 $x # exists $x->[0]->[1] # '', '', undef #
192 $x # exists $x->[0]->[1] # '', '', [ [ ] ] # +fetch
193 $x # exists $x->[0]->[1] # '', '', undef # +exists
194 $x # exists $x->[0]->[1] # '', '', [ [ ] ] # +delete
195 $x # exists $x->[0]->[1] # '', '', [ [ ] ] # +store
196
197 $x # exists $x->[0]->[1] # '', '', [ [ ] ] # +strict +fetch
198 $x # exists $x->[0]->[1] # qr/^Reference vivification forbidden/, undef, undef # +strict +exists
199 $x # exists $x->[0]->[1] # '', '', [ [ ] ] # +strict +delete
200 $x # exists $x->[0]->[1] # '', '', [ [ ] ] # +strict +store
201
202 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +fetch
203 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +fetch
204 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +exists
205 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +exists
206 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +delete
207 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +delete
208 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +store
209 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +store
210
211 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +strict +fetch
212 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +strict +fetch
213 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +strict +exists
214 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +strict +exists
215 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +strict +delete
216 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +strict +delete
217 $x->[0] = 1 # exists $x->[0] # '', 1, [ 1 ] # +strict +store
218 $x->[0] = 1 # exists $x->[1] # '', '', [ 1 ] # +strict +store
219
220 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +fetch
221 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +fetch
222 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ], undef, [ ] ] # +fetch
223 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +exists
224 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +exists
225 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ] ] # +exists
226 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +delete
227 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +delete
228 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ], undef, [ ] ] # +delete
229 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +store
230 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +store
231 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ], undef, [ ] ] # +store
232
233 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +fetch
234 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +strict +fetch
235 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ], undef, [ ] ] # +strict +fetch
236 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +exists
237 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +strict +exists
238 $x->[0]->[1] = 1 # exists $x->[2]->[3] # qr/^Reference vivification forbidden/, undef, [ [ undef, 1 ] ] # +strict +exists
239 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +delete
240 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +strict +delete
241 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ], undef, [ ] ] # +strict +delete
242 $x->[0]->[1] = 1 # exists $x->[0]->[1] # '', 1, [ [ undef, 1 ] ] # +strict +store
243 $x->[0]->[1] = 1 # exists $x->[0]->[3] # '', '', [ [ undef, 1 ] ] # +strict +store
244 $x->[0]->[1] = 1 # exists $x->[2]->[3] # '', '', [ [ undef, 1 ], undef, [ ] ] # +strict +store
245
246 --- delete ---
247
248 $x # delete $x->[0] # '', undef, [ ]
249 $x # delete $x->[0] # '', undef, undef #
250 $x # delete $x->[0] # '', undef, [ ] # +fetch
251 $x # delete $x->[0] # '', undef, [ ] # +exists
252 $x # delete $x->[0] # '', undef, undef # +delete
253 $x # delete $x->[0] # '', undef, [ ] # +store
254
255 $x # delete $x->[0] # '', undef, [ ] # +strict +fetch
256 $x # delete $x->[0] # '', undef, [ ] # +strict +exists
257 $x # delete $x->[0] # qr/^Reference vivification forbidden/, undef, undef # +strict +delete
258 $x # delete $x->[0] # '', undef, [ ] # +strict +store
259
260 $x # delete $x->[0]->[1] # '', undef, [ [ ] ]
261 $x # delete $x->[0]->[1] # '', undef, undef #
262 $x # delete $x->[0]->[1] # '', undef, [ [ ] ] # +fetch
263 $x # delete $x->[0]->[1] # '', undef, [ [ ] ] # +exists
264 $x # delete $x->[0]->[1] # '', undef, undef # +delete
265 $x # delete $x->[0]->[1] # '', undef, [ [ ] ] # +store
266
267 $x # delete $x->[0]->[1] # '', undef, [ [ ] ] # +strict +fetch
268 $x # delete $x->[0]->[1] # '', undef, [ [ ] ] # +strict +exists
269 $x # delete $x->[0]->[1] # qr/^Reference vivification forbidden/, undef, undef # +strict +delete
270 $x # delete $x->[0]->[1] # '', undef, [ [ ] ] # +strict +store
271
272 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +fetch
273 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +fetch
274 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +exists
275 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +exists
276 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +delete
277 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +delete
278 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +store
279 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +store
280
281 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +strict +fetch
282 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +strict +fetch
283 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +strict +exists
284 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +strict +exists
285 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +strict +delete
286 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +strict +delete
287 $x->[0] = 1 # delete $x->[0] # '', 1, [ ] # +strict +store
288 $x->[0] = 1 # delete $x->[1] # '', undef, [ 1 ] # +strict +store
289
290 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +fetch
291 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ]# +fetch
292 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +fetch
293 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +exists
294 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ]# +exists
295 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +exists
296 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +delete
297 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ]# +delete
298 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ] ]# +delete
299 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +store
300 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ]# +store
301 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ] # +store
302
303 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +strict +fetch
304 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +fetch
305 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ]# +strict +fetch
306 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +strict +exists
307 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +exists
308 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ]# +strict +exists
309 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +strict +delete
310 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +delete
311 $x->[0]->[1] = 1 # delete $x->[2]->[3] # qr/^Reference vivification forbidden/, undef, [ [ undef, 1 ] ] # +strict +delete
312 $x->[0]->[1] = 1 # delete $x->[0]->[1] # '', 1, [ [ ] ] # +strict +store
313 $x->[0]->[1] = 1 # delete $x->[0]->[3] # '', undef, [ [ undef, 1 ] ] # +strict +store
314 $x->[0]->[1] = 1 # delete $x->[2]->[3] # '', undef, [ [ undef, 1 ], undef, [ ] ]# +strict +store
315
316 --- store ---
317
318 $x # $x->[0] = 1 # '', 1, [ 1 ]
319 $x # $x->[0] = 1 # '', 1, [ 1 ] #
320 $x # $x->[0] = 1 # '', 1, [ 1 ] # +fetch
321 $x # $x->[0] = 1 # '', 1, [ 1 ] # +exists
322 $x # $x->[0] = 1 # '', 1, [ 1 ] # +delete
323 $x # $x->[0] = 1 # qr/^Can't vivify reference/, undef, undef # +store
324
325 $x # $x->[0] = 1 # '', 1, [ 1 ] # +strict +fetch
326 $x # $x->[0] = 1 # '', 1, [ 1 ] # +strict +exists
327 $x # $x->[0] = 1 # '', 1, [ 1 ] # +strict +delete
328 $x # $x->[0] = 1 # qr/^Reference vivification forbidden/, undef, undef # +strict +store
329
330 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ]
331 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] #
332 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] # +fetch
333 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] # +exists
334 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] # +delete
335 $x # $x->[0]->[1] = 1 # qr/^Can't vivify reference/, undef, undef # +store
336
337 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] # +strict +fetch
338 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] # +strict +exists
339 $x # $x->[0]->[1] = 1 # '', 1, [ [ undef, 1 ] ] # +strict +delete
340 $x # $x->[0]->[1] = 1 # qr/^Reference vivification forbidden/, undef, undef # +strict +store
341
342 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +fetch
343 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +fetch
344 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +exists
345 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +exists
346 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +delete
347 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +delete
348 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +store
349 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +store
350
351 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +strict +fetch
352 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +strict +fetch
353 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +strict +exists
354 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +strict +exists
355 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +strict +delete
356 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +strict +delete
357 $x->[0] = 1 # $x->[0] = 2 # '', 2, [ 2 ] # +strict +store
358 $x->[0] = 1 # $x->[1] = 2 # '', 2, [ 1, 2 ] # +strict +store
359
360 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +fetch
361 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +fetch
362 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # '', 2, [ [ undef, 1 ], undef, [ undef, undef, undef, 2 ] ] # +fetch
363 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +exists
364 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +exists
365 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # '', 2, [ [ undef, 1 ], undef, [ undef, undef, undef, 2 ] ] # +exists
366 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +delete
367 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +delete
368 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # '', 2, [ [ undef, 1 ], undef, [ undef, undef, undef, 2 ] ] # +delete
369 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +store
370 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +store
371 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # qr/^Can't vivify reference/, undef, [ [ undef, 1 ] ] # +store
372
373 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +strict +fetch
374 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +strict +fetch
375 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # '', 2, [ [ undef, 1 ], undef, [ undef, undef, undef, 2 ] ] # +strict +fetch
376 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +strict +exists
377 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +strict +exists
378 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # '', 2, [ [ undef, 1 ], undef, [ undef, undef, undef, 2 ] ] # +strict +exists
379 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +strict +delete
380 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +strict +delete
381 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # '', 2, [ [ undef, 1 ], undef, [ undef, undef, undef, 2 ] ] # +strict +delete
382 $x->[0]->[1] = 1 # $x->[0]->[1] = 2 # '', 2, [ [ undef, 2 ] ] # +strict +store
383 $x->[0]->[1] = 1 # $x->[0]->[3] = 2 # '', 2, [ [ undef, 1, undef, 2 ] ] # +strict +store
384 $x->[0]->[1] = 1 # $x->[2]->[3] = 2 # qr/^Reference vivification forbidden/, undef, [ [ undef, 1 ] ] # +strict +store