]> git.vpit.fr Git - perl/modules/autovivification.git/blob - t/20-hash.t
Initial import
[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 * 240;
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 --- exists ---
152
153 $x # exists $x->{a} # '', '', { }
154 $x # exists $x->{a} # '', '', undef #
155 $x # exists $x->{a} # '', '', { }   # +fetch
156 $x # exists $x->{a} # '', '', undef # +exists
157 $x # exists $x->{a} # '', '', { }   # +delete
158 $x # exists $x->{a} # '', '', { }   # +store
159
160 $x # exists $x->{a} # '', '', { } # +strict +fetch
161 $x # exists $x->{a} # qr/^Reference vivification forbidden/, undef, undef # +strict +exists
162 $x # exists $x->{a} # '', '', { } # +strict +delete
163 $x # exists $x->{a} # '', '', { } # +strict +store
164
165 $x # exists $x->{a}->{b} # '', '', { a => { } }
166 $x # exists $x->{a}->{b} # '', '', undef        #
167 $x # exists $x->{a}->{b} # '', '', { a => { } } # +fetch
168 $x # exists $x->{a}->{b} # '', '', undef        # +exists
169 $x # exists $x->{a}->{b} # '', '', { a => { } } # +delete
170 $x # exists $x->{a}->{b} # '', '', { a => { } } # +store
171
172 $x # exists $x->{a}->{b} # '', '', { a => { } } # +strict +fetch
173 $x # exists $x->{a}->{b} # qr/^Reference vivification forbidden/, undef, undef # +strict +exists
174 $x # exists $x->{a}->{b} # '', '', { a => { } } # +strict +delete
175 $x # exists $x->{a}->{b} # '', '', { a => { } } # +strict +store
176
177 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +fetch
178 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +fetch
179 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +exists
180 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +exists
181 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +delete
182 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +delete
183 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +store
184 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +store
185
186 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +fetch
187 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +fetch
188 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +exists
189 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +exists
190 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +delete
191 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +delete
192 $x->{a} = 1 # exists $x->{a} # '', 1,  { a => 1 } # +strict +store
193 $x->{a} = 1 # exists $x->{b} # '', '', { a => 1 } # +strict +store
194
195 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +fetch
196 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +fetch
197 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } } # +fetch
198 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +exists
199 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +exists
200 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 } } # +exists
201 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +delete
202 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +delete
203 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } } # +delete
204 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } } # +store
205 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } } # +store
206 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } } # +store
207
208 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +fetch
209 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +fetch
210 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } }  # +strict +fetch
211 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +exists
212 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +exists
213 $x->{a}->{b} = 1 # exists $x->{c}->{d} # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } }  # +strict +exists
214 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +delete
215 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +delete
216 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } }  # +strict +delete
217 $x->{a}->{b} = 1 # exists $x->{a}->{b} # '', 1,  { a => { b => 1 } }            # +strict +store
218 $x->{a}->{b} = 1 # exists $x->{a}->{d} # '', '', { a => { b => 1 } }            # +strict +store
219 $x->{a}->{b} = 1 # exists $x->{c}->{d} # '', '', { a => { b => 1 }, c => { } }  # +strict +store
220
221 --- delete ---
222
223 $x # delete $x->{a} # '', undef, { }
224 $x # delete $x->{a} # '', undef, undef #
225 $x # delete $x->{a} # '', undef, { }   # +fetch
226 $x # delete $x->{a} # '', undef, { }   # +exists
227 $x # delete $x->{a} # '', undef, undef # +delete
228 $x # delete $x->{a} # '', undef, { }   # +store
229
230 $x # delete $x->{a} # '', undef, { } # +strict +fetch
231 $x # delete $x->{a} # '', undef, { } # +strict +exists
232 $x # delete $x->{a} # qr/^Reference vivification forbidden/, undef, undef # +strict +delete
233 $x # delete $x->{a} # '', undef, { } # +strict +store
234
235 $x # delete $x->{a}->{b} # '', undef, { a => { } }
236 $x # delete $x->{a}->{b} # '', undef, undef        #
237 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +fetch
238 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +exists
239 $x # delete $x->{a}->{b} # '', undef, undef        # +delete
240 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +store
241
242 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +strict +fetch
243 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +strict +exists
244 $x # delete $x->{a}->{b} # qr/^Reference vivification forbidden/, undef, undef # +strict +delete
245 $x # delete $x->{a}->{b} # '', undef, { a => { } } # +strict +store
246
247 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +fetch
248 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +fetch
249 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +exists
250 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +exists
251 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +delete
252 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +delete
253 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +store
254 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +store
255
256 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +fetch
257 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +fetch
258 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +exists
259 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +exists
260 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +delete
261 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +delete
262 $x->{a} = 1 # delete $x->{a} # '', 1,     { }        # +strict +store
263 $x->{a} = 1 # delete $x->{b} # '', undef, { a => 1 } # +strict +store
264
265 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +fetch
266 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +fetch
267 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +fetch
268 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +exists
269 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +exists
270 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +exists
271 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +delete
272 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +delete
273 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 } }# +delete
274 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }       # +store
275 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }# +store
276 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => { } } # +store
277
278 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +fetch
279 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +fetch
280 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => {} }# +strict +fetch
281 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +exists
282 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +exists
283 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => {} }# +strict +exists
284 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +delete
285 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +delete
286 $x->{a}->{b} = 1 # delete $x->{c}->{d} # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } }  # +strict +delete
287 $x->{a}->{b} = 1 # delete $x->{a}->{b} # '', 1,     { a => { } }                # +strict +store
288 $x->{a}->{b} = 1 # delete $x->{a}->{d} # '', undef, { a => { b => 1 } }         # +strict +store
289 $x->{a}->{b} = 1 # delete $x->{c}->{d} # '', undef, { a => { b => 1 }, c => {} }# +strict +store
290
291 --- store ---
292
293 $x # $x->{a} = 1 # '', 1, { a => 1 }
294 $x # $x->{a} = 1 # '', 1, { a => 1 } #
295 $x # $x->{a} = 1 # '', 1, { a => 1 } # +fetch
296 $x # $x->{a} = 1 # '', 1, { a => 1 } # +exists
297 $x # $x->{a} = 1 # '', 1, { a => 1 } # +delete
298 $x # $x->{a} = 1 # qr/^Can't vivify reference/, undef, undef # +store
299
300 $x # $x->{a} = 1 # '', 1, { a => 1 } # +strict +fetch
301 $x # $x->{a} = 1 # '', 1, { a => 1 } # +strict +exists
302 $x # $x->{a} = 1 # '', 1, { a => 1 } # +strict +delete
303 $x # $x->{a} = 1 # qr/^Reference vivification forbidden/, undef, undef # +strict +store
304
305 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } }
306 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } #
307 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +fetch
308 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +exists
309 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +delete
310 $x # $x->{a}->{b} = 1 # qr/^Can't vivify reference/, undef, undef # +store
311
312 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +strict +fetch
313 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +strict +exists
314 $x # $x->{a}->{b} = 1 # '', 1, { a => { b => 1 } } # +strict +delete
315 $x # $x->{a}->{b} = 1 # qr/^Reference vivification forbidden/, undef, undef # +strict +store
316
317 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +fetch
318 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +fetch
319 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +exists
320 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +exists
321 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +delete
322 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +delete
323 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +store
324 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +store
325
326 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +fetch
327 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +fetch
328 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +exists
329 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +exists
330 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +delete
331 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +delete
332 $x->{a} = 1 # $x->{a} = 2 # '', 2, { a => 2 }         # +strict +store
333 $x->{a} = 1 # $x->{b} = 2 # '', 2, { a => 1, b => 2 } # +strict +store
334
335 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +fetch
336 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +fetch
337 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +fetch
338 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +exists
339 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +exists
340 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +exists
341 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +delete
342 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +delete
343 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +delete
344 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +store
345 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +store
346 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # qr/^Can't vivify reference/, undef, { a => { b => 1 } } # +store
347
348 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +fetch
349 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +fetch
350 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +strict +fetch
351 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +exists
352 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +exists
353 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +strict +exists
354 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +delete
355 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +delete
356 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # '', 2, { a => { b => 1 }, c => { d => 2 } } # +strict +delete
357 $x->{a}->{b} = 1 # $x->{a}->{b} = 2 # '', 2, { a => { b => 2 } }                # +strict +store
358 $x->{a}->{b} = 1 # $x->{a}->{d} = 2 # '', 2, { a => { b => 1, d => 2 } }        # +strict +store
359 $x->{a}->{b} = 1 # $x->{c}->{d} = 2 # qr/^Reference vivification forbidden/, undef, { a => { b => 1 } } # +strict +store