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