]> git.vpit.fr Git - perl/modules/autovivification.git/blob - t/20-hash.t
Don't vivify when aliasing
[perl/modules/autovivification.git] / t / 20-hash.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->{a} # '', undef, { } 
84 $x # $x->{a} # '', undef, undef #
85 $x # $x->{a} # '', undef, undef # +fetch
86 $x # $x->{a} # '', undef, { }   # +exists
87 $x # $x->{a} # '', undef, { }   # +delete
88 $x # $x->{a} # '', undef, { }   # +store
89
90 $x # $x->{a} # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
91 $x # $x->{a} # '', undef, { } # +strict +exists
92 $x # $x->{a} # '', undef, { } # +strict +delete
93 $x # $x->{a} # '', undef, { } # +strict +store
94
95 $x # $x->{a}->{b} # '', undef, { a => { } }
96 $x # $x->{a}->{b} # '', undef, undef        #
97 $x # $x->{a}->{b} # '', undef, undef        # +fetch
98 $x # $x->{a}->{b} # '', undef, { a => { } } # +exists
99 $x # $x->{a}->{b} # '', undef, { a => { } } # +delete
100 $x # $x->{a}->{b} # '', undef, { a => { } } # +store
101
102 $x # $x->{a}->{b} # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
103 $x # $x->{a}->{b} # '', undef, { a => { } } # +strict +exists
104 $x # $x->{a}->{b} # '', undef, { a => { } } # +strict +delete
105 $x # $x->{a}->{b} # '', undef, { a => { } } # +strict +store
106
107 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +fetch
108 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +fetch
109 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +exists
110 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +exists
111 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +delete
112 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +delete
113 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +store
114 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +store
115
116 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +strict +fetch
117 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +strict +fetch
118 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +strict +exists
119 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +strict +exists
120 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +strict +delete
121 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +strict +delete
122 $x->{a} = 1 # $x->{a} # '', 1,     { a => 1 } # +strict +store
123 $x->{a} = 1 # $x->{b} # '', undef, { a => 1 } # +strict +store
124
125 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } } # +fetch
126 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } } # +fetch
127 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 } } # +fetch
128 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } } # +exists
129 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } } # +exists
130 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +exists
131 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } } # +delete
132 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } } # +delete
133 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +delete
134 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } } # +store
135 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } } # +store
136 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +store
137
138 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } }                # +strict +fetch
139 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } }                # +strict +fetch
140 $x->{a}->{b} = 1 # $x->{c}->{d} # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } } # +strict +fetch
141 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } }                # +strict +exists
142 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } }                # +strict +exists
143 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } }      # +strict +exists
144 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } }                # +strict +delete
145 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } }                # +strict +delete
146 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } }      # +strict +delete
147 $x->{a}->{b} = 1 # $x->{a}->{b} # '', 1,     { a => { b => 1 } }                # +strict +store
148 $x->{a}->{b} = 1 # $x->{a}->{d} # '', undef, { a => { b => 1 } }                # +strict +store
149 $x->{a}->{b} = 1 # $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } }      # +strict +store
150
151 --- aliasing ---
152
153 $x # 1 for $x->{a}; () # '', undef, { a => undef }
154 $x # 1 for $x->{a}; () # '', undef, undef          #
155 $x # 1 for $x->{a}; () # '', undef, undef          # +fetch
156 $x # 1 for $x->{a}; () # '', undef, { a => undef } # +exists
157 $x # 1 for $x->{a}; () # '', undef, { a => undef } # +delete
158 $x # 1 for $x->{a}; () # '', undef, { a => undef } # +store
159
160 $x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 }
161 $x # $_ = 1 for $x->{a}; () # '', undef, undef      #
162 $x # $_ = 1 for $x->{a}; () # '', undef, undef      # +fetch
163 $x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } # +exists
164 $x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } # +delete
165 $x # $_ = 1 for $x->{a}; () # '', undef, { a => 1 } # +store
166
167 $x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 }             # +fetch
168 $x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +fetch
169 $x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 }             # +exists
170 $x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +exists
171 $x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 }             # +delete
172 $x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +delete
173 $x->{a} = 1 # 1 for $x->{a}; () # '', undef, { a => 1 }             # +store
174 $x->{a} = 1 # 1 for $x->{b}; () # '', undef, { a => 1, b => undef } # +store
175
176 --- exists ---
177
178 $x # exists $x->{a} # '', '', { }
179 $x # exists $x->{a} # '', '', undef #
180 $x # exists $x->{a} # '', '', { }   # +fetch
181 $x # exists $x->{a} # '', '', undef # +exists
182 $x # exists $x->{a} # '', '', { }   # +delete
183 $x # exists $x->{a} # '', '', { }   # +store
184
185 $x # exists $x->{a} # '', '', { } # +strict +fetch
186 $x # exists $x->{a} # qr/^Reference vivification forbidden/, undef, undef # +strict +exists
187 $x # exists $x->{a} # '', '', { } # +strict +delete
188 $x # exists $x->{a} # '', '', { } # +strict +store
189
190 $x # exists $x->{a}->{b} # '', '', { a => { } }
191 $x # exists $x->{a}->{b} # '', '', undef        #
192 $x # exists $x->{a}->{b} # '', '', { a => { } } # +fetch
193 $x # exists $x->{a}->{b} # '', '', undef        # +exists
194 $x # exists $x->{a}->{b} # '', '', { a => { } } # +delete
195 $x # exists $x->{a}->{b} # '', '', { a => { } } # +store
196
197 $x # exists $x->{a}->{b} # '', '', { a => { } } # +strict +fetch
198 $x # exists $x->{a}->{b} # qr/^Reference vivification forbidden/, undef, undef # +strict +exists
199 $x # exists $x->{a}->{b} # '', '', { a => { } } # +strict +delete
200 $x # exists $x->{a}->{b} # '', '', { a => { } } # +strict +store
201
202 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +fetch
203 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +fetch
204 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +exists
205 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +exists
206 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +delete
207 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +delete
208 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +store
209 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +store
210
211 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +fetch
212 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +fetch
213 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +exists
214 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +exists
215 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +delete
216 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +delete
217 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +store
218 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +store
219
220 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +fetch
221 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +fetch
222 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } } # +fetch
223 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +exists
224 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +exists
225 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 } } # +exists
226 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +delete
227 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +delete
228 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } } # +delete
229 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +store
230 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +store
231 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } } # +store
232
233 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +fetch
234 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +fetch
235 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } }  # +strict +fetch
236 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +exists
237 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +exists
238 $x->{a}->{b} = 1 # exists $x->{c}->{d} # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } }  # +strict +exists
239 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +delete
240 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +delete
241 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } }  # +strict +delete
242 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +store
243 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +store
244 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } }  # +strict +store
245
246 --- delete ---
247
248 $x # delete $x->{a} # '', undef, { }
249 $x # delete $x->{a} # '', undef, undef #
250 $x # delete $x->{a} # '', undef, { }   # +fetch
251 $x # delete $x->{a} # '', undef, { }   # +exists
252 $x # delete $x->{a} # '', undef, undef # +delete
253 $x # delete $x->{a} # '', undef, { }   # +store
254
255 $x # delete $x->{a} # '', undef, { } # +strict +fetch
256 $x # delete $x->{a} # '', undef, { } # +strict +exists
257 $x # delete $x->{a} # qr/^Reference vivification forbidden/, undef, undef # +strict +delete
258 $x # delete $x->{a} # '', undef, { } # +strict +store
259
260 $x # delete $x->{a}->{b} # '', undef, { a => { } }
261 $x # delete $x->{a}->{b} # '', undef, undef        #
262 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +fetch
263 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +exists
264 $x # delete $x->{a}->{b} # '', undef, undef        # +delete
265 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +store
266
267 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +strict +fetch
268 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +strict +exists
269 $x # delete $x->{a}->{b} # qr/^Reference vivification forbidden/, undef, undef # +strict +delete
270 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +strict +store
271
272 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +fetch
273 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +fetch
274 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +exists
275 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +exists
276 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +delete
277 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +delete
278 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +store
279 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +store
280
281 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +fetch
282 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +fetch
283 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +exists
284 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +exists
285 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +delete
286 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +delete
287 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +store
288 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +store
289
290 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +fetch
291 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +fetch
292 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +fetch
293 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +exists
294 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +exists
295 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +exists
296 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +delete
297 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +delete
298 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 } }# +delete
299 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +store
300 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +store
301 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +store
302
303 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +fetch
304 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +fetch
305 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => {} }# +strict +fetch
306 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +exists
307 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +exists
308 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => {} }# +strict +exists
309 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +delete
310 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +delete
311 $x->{a}->{b} = 1 # delete $x->{c}->{d} # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } }  # +strict +delete
312 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +store
313 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +store
314 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => {} }# +strict +store
315
316 --- store ---
317
318 $x # $x->{a} = 1 # '', 1, { a => 1 }
319 $x # $x->{a} = 1 # '', 1, { a => 1 } #
320 $x # $x->{a} = 1 # '', 1, { a => 1 } # +fetch
321 $x # $x->{a} = 1 # '', 1, { a => 1 } # +exists
322 $x # $x->{a} = 1 # '', 1, { a => 1 } # +delete
323 $x # $x->{a} = 1 # qr/^Can't vivify reference/, undef, undef # +store
324
325 $x # $x->{a} = 1 # '', 1, { a => 1 } # +strict +fetch
326 $x # $x->{a} = 1 # '', 1, { a => 1 } # +strict +exists
327 $x # $x->{a} = 1 # '', 1, { a => 1 } # +strict +delete
328 $x # $x->{a} = 1 # qr/^Reference vivification forbidden/, undef, undef # +strict +store
329
330 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } }
331 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } #
332 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +fetch
333 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +exists
334 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +delete
335 $x # $x->{a}->{b} = 1 # qr/^Can't vivify reference/, undef, undef # +store
336
337 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +strict +fetch
338 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +strict +exists
339 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +strict +delete
340 $x # $x->{a}->{b} = 1 # qr/^Reference vivification forbidden/, undef, undef # +strict +store
341
342 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +fetch
343 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +fetch
344 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +exists
345 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +exists
346 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +delete
347 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +delete
348 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +store
349 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +store
350
351 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +fetch
352 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +fetch
353 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +exists
354 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +exists
355 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +delete
356 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +delete
357 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +store
358 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +store
359
360 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +fetch
361 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +fetch
362 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +fetch
363 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +exists
364 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +exists
365 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +exists
366 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +delete
367 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +delete
368 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +delete
369 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +store
370 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +store
371 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # qr/^Can't vivify reference/, undef, { a => { b => 1 } } # +store
372
373 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +fetch
374 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +fetch
375 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +strict +fetch
376 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +exists
377 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +exists
378 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +strict +exists
379 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +delete
380 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +delete
381 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +strict +delete
382 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +store
383 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +store
384 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } } # +strict +store