1 package json_test
2
3 import (
4 "bytes"
5 "fmt"
6 "testing"
7
8 "github.com/goccy/go-json"
9 )
10
11 type coverMarshalText struct {
12 A int
13 }
14
15 func (c coverMarshalText) MarshalText() ([]byte, error) {
16 return []byte(`"hello"`), nil
17 }
18
19 type coverPtrMarshalText struct {
20 B int
21 }
22
23 func (c *coverPtrMarshalText) MarshalText() ([]byte, error) {
24 return []byte(`"hello"`), nil
25 }
26
27 func TestCoverMarshalText(t *testing.T) {
28 type structMarshalText struct {
29 A coverMarshalText `json:"a"`
30 }
31 type structMarshalTextOmitEmpty struct {
32 A coverMarshalText `json:"a,omitempty"`
33 }
34 type structMarshalTextString struct {
35 A coverMarshalText `json:"a,string"`
36 }
37 type structPtrMarshalText struct {
38 A coverPtrMarshalText `json:"a"`
39 }
40 type structPtrMarshalTextOmitEmpty struct {
41 A coverPtrMarshalText `json:"a,omitempty"`
42 }
43 type structPtrMarshalTextString struct {
44 A coverPtrMarshalText `json:"a,string"`
45 }
46
47 type structMarshalTextPtr struct {
48 A *coverMarshalText `json:"a"`
49 }
50 type structMarshalTextPtrOmitEmpty struct {
51 A *coverMarshalText `json:"a,omitempty"`
52 }
53 type structMarshalTextPtrString struct {
54 A *coverMarshalText `json:"a,string"`
55 }
56 type structPtrMarshalTextPtr struct {
57 A *coverPtrMarshalText `json:"a"`
58 }
59 type structPtrMarshalTextPtrOmitEmpty struct {
60 A *coverPtrMarshalText `json:"a,omitempty"`
61 }
62 type structPtrMarshalTextPtrString struct {
63 A *coverPtrMarshalText `json:"a,string"`
64 }
65
66 tests := []struct {
67 name string
68 data interface{}
69 }{
70
71 {
72 name: "HeadMarshalTextZero",
73 data: struct {
74 A coverMarshalText `json:"a"`
75 }{},
76 },
77 {
78 name: "HeadMarshalTextZeroOmitEmpty",
79 data: struct {
80 A coverMarshalText `json:"a,omitempty"`
81 }{},
82 },
83 {
84 name: "HeadMarshalTextZeroString",
85 data: struct {
86 A coverMarshalText `json:"a,string"`
87 }{},
88 },
89 {
90 name: "HeadPtrMarshalTextZero",
91 data: struct {
92 A coverPtrMarshalText `json:"a"`
93 }{},
94 },
95 {
96 name: "HeadPtrMarshalTextZeroOmitEmpty",
97 data: struct {
98 A coverPtrMarshalText `json:"a,omitempty"`
99 }{},
100 },
101 {
102 name: "HeadPtrMarshalTextZeroString",
103 data: struct {
104 A coverPtrMarshalText `json:"a,string"`
105 }{},
106 },
107
108
109 {
110 name: "HeadMarshalText",
111 data: struct {
112 A coverMarshalText `json:"a"`
113 }{A: coverMarshalText{}},
114 },
115 {
116 name: "HeadMarshalTextOmitEmpty",
117 data: struct {
118 A coverMarshalText `json:"a,omitempty"`
119 }{A: coverMarshalText{}},
120 },
121 {
122 name: "HeadMarshalTextString",
123 data: struct {
124 A coverMarshalText `json:"a,string"`
125 }{A: coverMarshalText{}},
126 },
127 {
128 name: "HeadPtrMarshalText",
129 data: struct {
130 A coverPtrMarshalText `json:"a"`
131 }{A: coverPtrMarshalText{}},
132 },
133 {
134 name: "HeadPtrMarshalTextOmitEmpty",
135 data: struct {
136 A coverPtrMarshalText `json:"a,omitempty"`
137 }{A: coverPtrMarshalText{}},
138 },
139 {
140 name: "HeadPtrMarshalTextString",
141 data: struct {
142 A coverPtrMarshalText `json:"a,string"`
143 }{A: coverPtrMarshalText{}},
144 },
145
146
147 {
148 name: "HeadMarshalTextPtr",
149 data: struct {
150 A *coverMarshalText `json:"a"`
151 }{A: &coverMarshalText{}},
152 },
153 {
154 name: "HeadMarshalTextPtrOmitEmpty",
155 data: struct {
156 A *coverMarshalText `json:"a,omitempty"`
157 }{A: &coverMarshalText{}},
158 },
159 {
160 name: "HeadMarshalTextPtrString",
161 data: struct {
162 A *coverMarshalText `json:"a,string"`
163 }{A: &coverMarshalText{}},
164 },
165 {
166 name: "HeadPtrMarshalTextPtr",
167 data: struct {
168 A *coverPtrMarshalText `json:"a"`
169 }{A: &coverPtrMarshalText{}},
170 },
171 {
172 name: "HeadPtrMarshalTextPtrOmitEmpty",
173 data: struct {
174 A *coverPtrMarshalText `json:"a,omitempty"`
175 }{A: &coverPtrMarshalText{}},
176 },
177 {
178 name: "HeadPtrMarshalTextPtrString",
179 data: struct {
180 A *coverPtrMarshalText `json:"a,string"`
181 }{A: &coverPtrMarshalText{}},
182 },
183
184
185 {
186 name: "HeadMarshalTextPtrNil",
187 data: struct {
188 A *coverMarshalText `json:"a"`
189 }{A: nil},
190 },
191 {
192 name: "HeadMarshalTextPtrNilOmitEmpty",
193 data: struct {
194 A *coverMarshalText `json:"a,omitempty"`
195 }{A: nil},
196 },
197 {
198 name: "HeadMarshalTextPtrNilString",
199 data: struct {
200 A *coverMarshalText `json:"a,string"`
201 }{A: nil},
202 },
203 {
204 name: "HeadPtrMarshalTextPtrNil",
205 data: struct {
206 A *coverPtrMarshalText `json:"a"`
207 }{A: nil},
208 },
209 {
210 name: "HeadPtrMarshalTextPtrNilOmitEmpty",
211 data: struct {
212 A *coverPtrMarshalText `json:"a,omitempty"`
213 }{A: nil},
214 },
215 {
216 name: "HeadPtrMarshalTextPtrNilString",
217 data: struct {
218 A *coverPtrMarshalText `json:"a,string"`
219 }{A: nil},
220 },
221
222
223 {
224 name: "PtrHeadMarshalTextZero",
225 data: &struct {
226 A coverMarshalText `json:"a"`
227 }{},
228 },
229 {
230 name: "PtrHeadMarshalTextZeroOmitEmpty",
231 data: &struct {
232 A coverMarshalText `json:"a,omitempty"`
233 }{},
234 },
235 {
236 name: "PtrHeadMarshalTextZeroString",
237 data: &struct {
238 A coverMarshalText `json:"a,string"`
239 }{},
240 },
241 {
242 name: "PtrHeadPtrMarshalTextZero",
243 data: &struct {
244 A coverPtrMarshalText `json:"a"`
245 }{},
246 },
247 {
248 name: "PtrHeadPtrMarshalTextZeroOmitEmpty",
249 data: &struct {
250 A coverPtrMarshalText `json:"a,omitempty"`
251 }{},
252 },
253 {
254 name: "PtrHeadPtrMarshalTextZeroString",
255 data: &struct {
256 A coverPtrMarshalText `json:"a,string"`
257 }{},
258 },
259
260
261 {
262 name: "PtrHeadMarshalText",
263 data: &struct {
264 A coverMarshalText `json:"a"`
265 }{A: coverMarshalText{}},
266 },
267 {
268 name: "PtrHeadMarshalTextOmitEmpty",
269 data: &struct {
270 A coverMarshalText `json:"a,omitempty"`
271 }{A: coverMarshalText{}},
272 },
273 {
274 name: "PtrHeadMarshalTextString",
275 data: &struct {
276 A coverMarshalText `json:"a,string"`
277 }{A: coverMarshalText{}},
278 },
279 {
280 name: "PtrHeadPtrMarshalText",
281 data: &struct {
282 A coverPtrMarshalText `json:"a"`
283 }{A: coverPtrMarshalText{}},
284 },
285 {
286 name: "PtrHeadPtrMarshalTextOmitEmpty",
287 data: &struct {
288 A coverPtrMarshalText `json:"a,omitempty"`
289 }{A: coverPtrMarshalText{}},
290 },
291 {
292 name: "PtrHeadPtrMarshalTextString",
293 data: &struct {
294 A coverPtrMarshalText `json:"a,string"`
295 }{A: coverPtrMarshalText{}},
296 },
297
298
299 {
300 name: "PtrHeadMarshalTextPtr",
301 data: &struct {
302 A *coverMarshalText `json:"a"`
303 }{A: &coverMarshalText{}},
304 },
305 {
306 name: "PtrHeadMarshalTextPtrOmitEmpty",
307 data: &struct {
308 A *coverMarshalText `json:"a,omitempty"`
309 }{A: &coverMarshalText{}},
310 },
311 {
312 name: "PtrHeadMarshalTextPtrString",
313 data: &struct {
314 A *coverMarshalText `json:"a,string"`
315 }{A: &coverMarshalText{}},
316 },
317 {
318 name: "PtrHeadPtrMarshalTextPtr",
319 data: &struct {
320 A *coverPtrMarshalText `json:"a"`
321 }{A: &coverPtrMarshalText{}},
322 },
323 {
324 name: "PtrHeadPtrMarshalTextPtrOmitEmpty",
325 data: &struct {
326 A *coverPtrMarshalText `json:"a,omitempty"`
327 }{A: &coverPtrMarshalText{}},
328 },
329 {
330 name: "PtrHeadPtrMarshalTextPtrString",
331 data: &struct {
332 A *coverPtrMarshalText `json:"a,string"`
333 }{A: &coverPtrMarshalText{}},
334 },
335
336
337 {
338 name: "PtrHeadMarshalTextPtrNil",
339 data: &struct {
340 A *coverMarshalText `json:"a"`
341 }{A: nil},
342 },
343 {
344 name: "PtrHeadMarshalTextPtrNilOmitEmpty",
345 data: &struct {
346 A *coverMarshalText `json:"a,omitempty"`
347 }{A: nil},
348 },
349 {
350 name: "PtrHeadMarshalTextPtrNilString",
351 data: &struct {
352 A *coverMarshalText `json:"a,string"`
353 }{A: nil},
354 },
355 {
356 name: "PtrHeadPtrMarshalTextPtrNil",
357 data: &struct {
358 A *coverPtrMarshalText `json:"a"`
359 }{A: nil},
360 },
361 {
362 name: "PtrHeadPtrMarshalTextPtrNilOmitEmpty",
363 data: &struct {
364 A *coverPtrMarshalText `json:"a,omitempty"`
365 }{A: nil},
366 },
367 {
368 name: "PtrHeadPtrMarshalTextPtrNilString",
369 data: &struct {
370 A *coverPtrMarshalText `json:"a,string"`
371 }{A: nil},
372 },
373
374
375 {
376 name: "PtrHeadMarshalTextNil",
377 data: (*struct {
378 A *coverMarshalText `json:"a"`
379 })(nil),
380 },
381 {
382 name: "PtrHeadMarshalTextNilOmitEmpty",
383 data: (*struct {
384 A *coverMarshalText `json:"a,omitempty"`
385 })(nil),
386 },
387 {
388 name: "PtrHeadMarshalTextNilString",
389 data: (*struct {
390 A *coverMarshalText `json:"a,string"`
391 })(nil),
392 },
393 {
394 name: "PtrHeadPtrMarshalTextNil",
395 data: (*struct {
396 A *coverPtrMarshalText `json:"a"`
397 })(nil),
398 },
399 {
400 name: "PtrHeadPtrMarshalTextNilOmitEmpty",
401 data: (*struct {
402 A *coverPtrMarshalText `json:"a,omitempty"`
403 })(nil),
404 },
405 {
406 name: "PtrHeadPtrMarshalTextNilString",
407 data: (*struct {
408 A *coverPtrMarshalText `json:"a,string"`
409 })(nil),
410 },
411
412
413 {
414 name: "HeadMarshalTextZeroMultiFields",
415 data: struct {
416 A coverMarshalText `json:"a"`
417 B coverMarshalText `json:"b"`
418 C coverMarshalText `json:"c"`
419 }{},
420 },
421 {
422 name: "HeadMarshalTextZeroMultiFieldsOmitEmpty",
423 data: struct {
424 A coverMarshalText `json:"a,omitempty"`
425 B coverMarshalText `json:"b,omitempty"`
426 C coverMarshalText `json:"c,omitempty"`
427 }{},
428 },
429 {
430 name: "HeadMarshalTextZeroMultiFields",
431 data: struct {
432 A coverMarshalText `json:"a,string"`
433 B coverMarshalText `json:"b,string"`
434 C coverMarshalText `json:"c,string"`
435 }{},
436 },
437 {
438 name: "HeadPtrMarshalTextZeroMultiFields",
439 data: struct {
440 A coverPtrMarshalText `json:"a"`
441 B coverPtrMarshalText `json:"b"`
442 C coverPtrMarshalText `json:"c"`
443 }{},
444 },
445 {
446 name: "HeadPtrMarshalTextZeroMultiFieldsOmitEmpty",
447 data: struct {
448 A coverPtrMarshalText `json:"a,omitempty"`
449 B coverPtrMarshalText `json:"b,omitempty"`
450 C coverPtrMarshalText `json:"c,omitempty"`
451 }{},
452 },
453 {
454 name: "HeadPtrMarshalTextZeroMultiFields",
455 data: struct {
456 A coverPtrMarshalText `json:"a,string"`
457 B coverPtrMarshalText `json:"b,string"`
458 C coverPtrMarshalText `json:"c,string"`
459 }{},
460 },
461
462
463 {
464 name: "HeadMarshalTextMultiFields",
465 data: struct {
466 A coverMarshalText `json:"a"`
467 B coverMarshalText `json:"b"`
468 C coverMarshalText `json:"c"`
469 }{A: coverMarshalText{}, B: coverMarshalText{}, C: coverMarshalText{}},
470 },
471 {
472 name: "HeadMarshalTextMultiFieldsOmitEmpty",
473 data: struct {
474 A coverMarshalText `json:"a,omitempty"`
475 B coverMarshalText `json:"b,omitempty"`
476 C coverMarshalText `json:"c,omitempty"`
477 }{A: coverMarshalText{}, B: coverMarshalText{}, C: coverMarshalText{}},
478 },
479 {
480 name: "HeadMarshalTextMultiFieldsString",
481 data: struct {
482 A coverMarshalText `json:"a,string"`
483 B coverMarshalText `json:"b,string"`
484 C coverMarshalText `json:"c,string"`
485 }{A: coverMarshalText{}, B: coverMarshalText{}, C: coverMarshalText{}},
486 },
487 {
488 name: "HeadPtrMarshalTextMultiFields",
489 data: struct {
490 A coverPtrMarshalText `json:"a"`
491 B coverPtrMarshalText `json:"b"`
492 C coverPtrMarshalText `json:"c"`
493 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}, C: coverPtrMarshalText{}},
494 },
495 {
496 name: "HeadPtrMarshalTextMultiFieldsOmitEmpty",
497 data: struct {
498 A coverPtrMarshalText `json:"a,omitempty"`
499 B coverPtrMarshalText `json:"b,omitempty"`
500 C coverPtrMarshalText `json:"c,omitempty"`
501 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}, C: coverPtrMarshalText{}},
502 },
503 {
504 name: "HeadPtrMarshalTextMultiFieldsString",
505 data: struct {
506 A coverPtrMarshalText `json:"a,string"`
507 B coverPtrMarshalText `json:"b,string"`
508 C coverPtrMarshalText `json:"c,string"`
509 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}, C: coverPtrMarshalText{}},
510 },
511
512
513 {
514 name: "HeadMarshalTextPtrMultiFields",
515 data: struct {
516 A *coverMarshalText `json:"a"`
517 B *coverMarshalText `json:"b"`
518 C *coverMarshalText `json:"c"`
519 }{A: &coverMarshalText{}, B: &coverMarshalText{}, C: &coverMarshalText{}},
520 },
521 {
522 name: "HeadMarshalTextPtrMultiFieldsOmitEmpty",
523 data: struct {
524 A *coverMarshalText `json:"a,omitempty"`
525 B *coverMarshalText `json:"b,omitempty"`
526 C *coverMarshalText `json:"c,omitempty"`
527 }{A: &coverMarshalText{}, B: &coverMarshalText{}, C: &coverMarshalText{}},
528 },
529 {
530 name: "HeadMarshalTextPtrMultiFieldsString",
531 data: struct {
532 A *coverMarshalText `json:"a,string"`
533 B *coverMarshalText `json:"b,string"`
534 C *coverMarshalText `json:"c,string"`
535 }{A: &coverMarshalText{}, B: &coverMarshalText{}, C: &coverMarshalText{}},
536 },
537 {
538 name: "HeadPtrMarshalTextPtrMultiFields",
539 data: struct {
540 A *coverPtrMarshalText `json:"a"`
541 B *coverPtrMarshalText `json:"b"`
542 C *coverPtrMarshalText `json:"c"`
543 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}, C: &coverPtrMarshalText{}},
544 },
545 {
546 name: "HeadPtrMarshalTextPtrMultiFieldsOmitEmpty",
547 data: struct {
548 A *coverPtrMarshalText `json:"a,omitempty"`
549 B *coverPtrMarshalText `json:"b,omitempty"`
550 C *coverPtrMarshalText `json:"c,omitempty"`
551 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}, C: &coverPtrMarshalText{}},
552 },
553 {
554 name: "HeadPtrMarshalTextPtrMultiFieldsString",
555 data: struct {
556 A *coverPtrMarshalText `json:"a,string"`
557 B *coverPtrMarshalText `json:"b,string"`
558 C *coverPtrMarshalText `json:"c,string"`
559 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}, C: &coverPtrMarshalText{}},
560 },
561
562
563 {
564 name: "HeadMarshalTextPtrNilMultiFields",
565 data: struct {
566 A *coverMarshalText `json:"a"`
567 B *coverMarshalText `json:"b"`
568 C *coverMarshalText `json:"c"`
569 }{A: nil, B: nil, C: nil},
570 },
571 {
572 name: "HeadMarshalTextPtrNilMultiFieldsOmitEmpty",
573 data: struct {
574 A *coverMarshalText `json:"a,omitempty"`
575 B *coverMarshalText `json:"b,omitempty"`
576 C *coverMarshalText `json:"c,omitempty"`
577 }{A: nil, B: nil, C: nil},
578 },
579 {
580 name: "HeadMarshalTextPtrNilMultiFieldsString",
581 data: struct {
582 A *coverMarshalText `json:"a,string"`
583 B *coverMarshalText `json:"b,string"`
584 C *coverMarshalText `json:"c,string"`
585 }{A: nil, B: nil, C: nil},
586 },
587 {
588 name: "HeadPtrMarshalTextPtrNilMultiFields",
589 data: struct {
590 A *coverPtrMarshalText `json:"a"`
591 B *coverPtrMarshalText `json:"b"`
592 C *coverPtrMarshalText `json:"c"`
593 }{A: nil, B: nil, C: nil},
594 },
595 {
596 name: "HeadPtrMarshalTextPtrNilMultiFieldsOmitEmpty",
597 data: struct {
598 A *coverPtrMarshalText `json:"a,omitempty"`
599 B *coverPtrMarshalText `json:"b,omitempty"`
600 C *coverPtrMarshalText `json:"c,omitempty"`
601 }{A: nil, B: nil, C: nil},
602 },
603 {
604 name: "HeadPtrMarshalTextPtrNilMultiFieldsString",
605 data: struct {
606 A *coverPtrMarshalText `json:"a,string"`
607 B *coverPtrMarshalText `json:"b,string"`
608 C *coverPtrMarshalText `json:"c,string"`
609 }{A: nil, B: nil, C: nil},
610 },
611
612
613 {
614 name: "PtrHeadMarshalTextZeroMultiFields",
615 data: &struct {
616 A coverMarshalText `json:"a"`
617 B coverMarshalText `json:"b"`
618 }{},
619 },
620 {
621 name: "PtrHeadMarshalTextZeroMultiFieldsOmitEmpty",
622 data: &struct {
623 A coverMarshalText `json:"a,omitempty"`
624 B coverMarshalText `json:"b,omitempty"`
625 }{},
626 },
627 {
628 name: "PtrHeadMarshalTextZeroMultiFieldsString",
629 data: &struct {
630 A coverMarshalText `json:"a,string"`
631 B coverMarshalText `json:"b,string"`
632 }{},
633 },
634 {
635 name: "PtrHeadPtrMarshalTextZeroMultiFields",
636 data: &struct {
637 A coverPtrMarshalText `json:"a"`
638 B coverPtrMarshalText `json:"b"`
639 }{},
640 },
641 {
642 name: "PtrHeadPtrMarshalTextZeroMultiFieldsOmitEmpty",
643 data: &struct {
644 A coverPtrMarshalText `json:"a,omitempty"`
645 B coverPtrMarshalText `json:"b,omitempty"`
646 }{},
647 },
648 {
649 name: "PtrHeadPtrMarshalTextZeroMultiFieldsString",
650 data: &struct {
651 A coverPtrMarshalText `json:"a,string"`
652 B coverPtrMarshalText `json:"b,string"`
653 }{},
654 },
655
656
657 {
658 name: "PtrHeadMarshalTextMultiFields",
659 data: &struct {
660 A coverMarshalText `json:"a"`
661 B coverMarshalText `json:"b"`
662 }{A: coverMarshalText{}, B: coverMarshalText{}},
663 },
664 {
665 name: "PtrHeadMarshalTextMultiFieldsOmitEmpty",
666 data: &struct {
667 A coverMarshalText `json:"a,omitempty"`
668 B coverMarshalText `json:"b,omitempty"`
669 }{A: coverMarshalText{}, B: coverMarshalText{}},
670 },
671 {
672 name: "PtrHeadMarshalTextMultiFieldsString",
673 data: &struct {
674 A coverMarshalText `json:"a,string"`
675 B coverMarshalText `json:"b,string"`
676 }{A: coverMarshalText{}, B: coverMarshalText{}},
677 },
678 {
679 name: "PtrHeadPtrMarshalTextMultiFields",
680 data: &struct {
681 A coverPtrMarshalText `json:"a"`
682 B coverPtrMarshalText `json:"b"`
683 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}},
684 },
685 {
686 name: "PtrHeadPtrMarshalTextMultiFieldsOmitEmpty",
687 data: &struct {
688 A coverPtrMarshalText `json:"a,omitempty"`
689 B coverPtrMarshalText `json:"b,omitempty"`
690 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}},
691 },
692 {
693 name: "PtrHeadPtrMarshalTextMultiFieldsString",
694 data: &struct {
695 A coverPtrMarshalText `json:"a,string"`
696 B coverPtrMarshalText `json:"b,string"`
697 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}},
698 },
699
700
701 {
702 name: "PtrHeadMarshalTextPtrMultiFields",
703 data: &struct {
704 A *coverMarshalText `json:"a"`
705 B *coverMarshalText `json:"b"`
706 }{A: &coverMarshalText{}, B: &coverMarshalText{}},
707 },
708 {
709 name: "PtrHeadMarshalTextPtrMultiFieldsOmitEmpty",
710 data: &struct {
711 A *coverMarshalText `json:"a,omitempty"`
712 B *coverMarshalText `json:"b,omitempty"`
713 }{A: &coverMarshalText{}, B: &coverMarshalText{}},
714 },
715 {
716 name: "PtrHeadMarshalTextPtrMultiFieldsString",
717 data: &struct {
718 A *coverMarshalText `json:"a,string"`
719 B *coverMarshalText `json:"b,string"`
720 }{A: &coverMarshalText{}, B: &coverMarshalText{}},
721 },
722 {
723 name: "PtrHeadPtrMarshalTextPtrMultiFields",
724 data: &struct {
725 A *coverPtrMarshalText `json:"a"`
726 B *coverPtrMarshalText `json:"b"`
727 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}},
728 },
729 {
730 name: "PtrHeadPtrMarshalTextPtrMultiFieldsOmitEmpty",
731 data: &struct {
732 A *coverPtrMarshalText `json:"a,omitempty"`
733 B *coverPtrMarshalText `json:"b,omitempty"`
734 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}},
735 },
736 {
737 name: "PtrHeadPtrMarshalTextPtrMultiFieldsString",
738 data: &struct {
739 A *coverPtrMarshalText `json:"a,string"`
740 B *coverPtrMarshalText `json:"b,string"`
741 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}},
742 },
743
744
745 {
746 name: "PtrHeadMarshalTextPtrNilMultiFields",
747 data: &struct {
748 A *coverMarshalText `json:"a"`
749 B *coverMarshalText `json:"b"`
750 }{A: nil, B: nil},
751 },
752 {
753 name: "PtrHeadMarshalTextPtrNilMultiFieldsOmitEmpty",
754 data: &struct {
755 A *coverMarshalText `json:"a,omitempty"`
756 B *coverMarshalText `json:"b,omitempty"`
757 }{A: nil, B: nil},
758 },
759 {
760 name: "PtrHeadMarshalTextPtrNilMultiFieldsString",
761 data: &struct {
762 A *coverMarshalText `json:"a,string"`
763 B *coverMarshalText `json:"b,string"`
764 }{A: nil, B: nil},
765 },
766 {
767 name: "PtrHeadPtrMarshalTextPtrNilMultiFields",
768 data: &struct {
769 A *coverPtrMarshalText `json:"a"`
770 B *coverPtrMarshalText `json:"b"`
771 }{A: nil, B: nil},
772 },
773 {
774 name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsOmitEmpty",
775 data: &struct {
776 A *coverPtrMarshalText `json:"a,omitempty"`
777 B *coverPtrMarshalText `json:"b,omitempty"`
778 }{A: nil, B: nil},
779 },
780 {
781 name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsString",
782 data: &struct {
783 A *coverPtrMarshalText `json:"a,string"`
784 B *coverPtrMarshalText `json:"b,string"`
785 }{A: nil, B: nil},
786 },
787
788
789 {
790 name: "PtrHeadMarshalTextNilMultiFields",
791 data: (*struct {
792 A coverMarshalText `json:"a"`
793 B coverMarshalText `json:"b"`
794 })(nil),
795 },
796 {
797 name: "PtrHeadMarshalTextNilMultiFieldsOmitEmpty",
798 data: (*struct {
799 A coverMarshalText `json:"a,omitempty"`
800 B coverMarshalText `json:"b,omitempty"`
801 })(nil),
802 },
803 {
804 name: "PtrHeadMarshalTextNilMultiFieldsString",
805 data: (*struct {
806 A coverMarshalText `json:"a,string"`
807 B coverMarshalText `json:"b,string"`
808 })(nil),
809 },
810 {
811 name: "PtrHeadPtrMarshalTextNilMultiFields",
812 data: (*struct {
813 A coverPtrMarshalText `json:"a"`
814 B coverPtrMarshalText `json:"b"`
815 })(nil),
816 },
817 {
818 name: "PtrHeadPtrMarshalTextNilMultiFieldsOmitEmpty",
819 data: (*struct {
820 A coverPtrMarshalText `json:"a,omitempty"`
821 B coverPtrMarshalText `json:"b,omitempty"`
822 })(nil),
823 },
824 {
825 name: "PtrHeadPtrMarshalTextNilMultiFieldsString",
826 data: (*struct {
827 A coverPtrMarshalText `json:"a,string"`
828 B coverPtrMarshalText `json:"b,string"`
829 })(nil),
830 },
831
832
833 {
834 name: "PtrHeadMarshalTextNilMultiFields",
835 data: (*struct {
836 A *coverMarshalText `json:"a"`
837 B *coverMarshalText `json:"b"`
838 })(nil),
839 },
840 {
841 name: "PtrHeadMarshalTextNilMultiFieldsOmitEmpty",
842 data: (*struct {
843 A *coverMarshalText `json:"a,omitempty"`
844 B *coverMarshalText `json:"b,omitempty"`
845 })(nil),
846 },
847 {
848 name: "PtrHeadMarshalTextNilMultiFieldsString",
849 data: (*struct {
850 A *coverMarshalText `json:"a,string"`
851 B *coverMarshalText `json:"b,string"`
852 })(nil),
853 },
854 {
855 name: "PtrHeadPtrMarshalTextNilMultiFields",
856 data: (*struct {
857 A *coverPtrMarshalText `json:"a"`
858 B *coverPtrMarshalText `json:"b"`
859 })(nil),
860 },
861 {
862 name: "PtrHeadPtrMarshalTextNilMultiFieldsOmitEmpty",
863 data: (*struct {
864 A *coverPtrMarshalText `json:"a,omitempty"`
865 B *coverPtrMarshalText `json:"b,omitempty"`
866 })(nil),
867 },
868 {
869 name: "PtrHeadPtrMarshalTextNilMultiFieldsString",
870 data: (*struct {
871 A *coverPtrMarshalText `json:"a,string"`
872 B *coverPtrMarshalText `json:"b,string"`
873 })(nil),
874 },
875
876
877 {
878 name: "HeadMarshalTextZeroNotRoot",
879 data: struct {
880 A struct {
881 A coverMarshalText `json:"a"`
882 }
883 }{},
884 },
885 {
886 name: "HeadMarshalTextZeroNotRootOmitEmpty",
887 data: struct {
888 A struct {
889 A coverMarshalText `json:"a,omitempty"`
890 }
891 }{},
892 },
893 {
894 name: "HeadMarshalTextZeroNotRootString",
895 data: struct {
896 A struct {
897 A coverMarshalText `json:"a,string"`
898 }
899 }{},
900 },
901 {
902 name: "HeadPtrMarshalTextZeroNotRoot",
903 data: struct {
904 A struct {
905 A coverPtrMarshalText `json:"a"`
906 }
907 }{},
908 },
909 {
910 name: "HeadPtrMarshalTextZeroNotRootOmitEmpty",
911 data: struct {
912 A struct {
913 A coverPtrMarshalText `json:"a,omitempty"`
914 }
915 }{},
916 },
917 {
918 name: "HeadPtrMarshalTextZeroNotRootString",
919 data: struct {
920 A struct {
921 A coverPtrMarshalText `json:"a,string"`
922 }
923 }{},
924 },
925
926
927 {
928 name: "HeadMarshalTextNotRoot",
929 data: struct {
930 A struct {
931 A coverMarshalText `json:"a"`
932 }
933 }{A: struct {
934 A coverMarshalText `json:"a"`
935 }{A: coverMarshalText{}}},
936 },
937 {
938 name: "HeadMarshalTextNotRootOmitEmpty",
939 data: struct {
940 A struct {
941 A coverMarshalText `json:"a,omitempty"`
942 }
943 }{A: struct {
944 A coverMarshalText `json:"a,omitempty"`
945 }{A: coverMarshalText{}}},
946 },
947 {
948 name: "HeadMarshalTextNotRootString",
949 data: struct {
950 A struct {
951 A coverMarshalText `json:"a,string"`
952 }
953 }{A: struct {
954 A coverMarshalText `json:"a,string"`
955 }{A: coverMarshalText{}}},
956 },
957 {
958 name: "HeadMarshalTextNotRoot",
959 data: struct {
960 A struct {
961 A coverPtrMarshalText `json:"a"`
962 }
963 }{A: struct {
964 A coverPtrMarshalText `json:"a"`
965 }{A: coverPtrMarshalText{}}},
966 },
967 {
968 name: "HeadMarshalTextNotRootOmitEmpty",
969 data: struct {
970 A struct {
971 A coverPtrMarshalText `json:"a,omitempty"`
972 }
973 }{A: struct {
974 A coverPtrMarshalText `json:"a,omitempty"`
975 }{A: coverPtrMarshalText{}}},
976 },
977 {
978 name: "HeadMarshalTextNotRootString",
979 data: struct {
980 A struct {
981 A coverPtrMarshalText `json:"a,string"`
982 }
983 }{A: struct {
984 A coverPtrMarshalText `json:"a,string"`
985 }{A: coverPtrMarshalText{}}},
986 },
987
988
989 {
990 name: "HeadMarshalTextPtrNotRoot",
991 data: struct {
992 A struct {
993 A *coverMarshalText `json:"a"`
994 }
995 }{A: struct {
996 A *coverMarshalText `json:"a"`
997 }{&coverMarshalText{}}},
998 },
999 {
1000 name: "HeadMarshalTextPtrNotRootOmitEmpty",
1001 data: struct {
1002 A struct {
1003 A *coverMarshalText `json:"a,omitempty"`
1004 }
1005 }{A: struct {
1006 A *coverMarshalText `json:"a,omitempty"`
1007 }{&coverMarshalText{}}},
1008 },
1009 {
1010 name: "HeadMarshalTextPtrNotRootString",
1011 data: struct {
1012 A struct {
1013 A *coverMarshalText `json:"a,string"`
1014 }
1015 }{A: struct {
1016 A *coverMarshalText `json:"a,string"`
1017 }{&coverMarshalText{}}},
1018 },
1019 {
1020 name: "HeadPtrMarshalTextPtrNotRoot",
1021 data: struct {
1022 A struct {
1023 A *coverPtrMarshalText `json:"a"`
1024 }
1025 }{A: struct {
1026 A *coverPtrMarshalText `json:"a"`
1027 }{&coverPtrMarshalText{}}},
1028 },
1029 {
1030 name: "HeadPtrMarshalTextPtrNotRootOmitEmpty",
1031 data: struct {
1032 A struct {
1033 A *coverPtrMarshalText `json:"a,omitempty"`
1034 }
1035 }{A: struct {
1036 A *coverPtrMarshalText `json:"a,omitempty"`
1037 }{&coverPtrMarshalText{}}},
1038 },
1039 {
1040 name: "HeadPtrMarshalTextPtrNotRootString",
1041 data: struct {
1042 A struct {
1043 A *coverPtrMarshalText `json:"a,string"`
1044 }
1045 }{A: struct {
1046 A *coverPtrMarshalText `json:"a,string"`
1047 }{&coverPtrMarshalText{}}},
1048 },
1049
1050
1051 {
1052 name: "HeadMarshalTextPtrNilNotRoot",
1053 data: struct {
1054 A struct {
1055 A *coverMarshalText `json:"a"`
1056 }
1057 }{},
1058 },
1059 {
1060 name: "HeadMarshalTextPtrNilNotRootOmitEmpty",
1061 data: struct {
1062 A struct {
1063 A *coverMarshalText `json:"a,omitempty"`
1064 }
1065 }{},
1066 },
1067 {
1068 name: "HeadMarshalTextPtrNilNotRootString",
1069 data: struct {
1070 A struct {
1071 A *coverMarshalText `json:"a,string"`
1072 }
1073 }{},
1074 },
1075 {
1076 name: "HeadPtrMarshalTextPtrNilNotRoot",
1077 data: struct {
1078 A struct {
1079 A *coverPtrMarshalText `json:"a"`
1080 }
1081 }{},
1082 },
1083 {
1084 name: "HeadPtrMarshalTextPtrNilNotRootOmitEmpty",
1085 data: struct {
1086 A struct {
1087 A *coverPtrMarshalText `json:"a,omitempty"`
1088 }
1089 }{},
1090 },
1091 {
1092 name: "HeadPtrMarshalTextPtrNilNotRootString",
1093 data: struct {
1094 A struct {
1095 A *coverPtrMarshalText `json:"a,string"`
1096 }
1097 }{},
1098 },
1099
1100
1101 {
1102 name: "PtrHeadMarshalTextZeroNotRoot",
1103 data: struct {
1104 A *struct {
1105 A coverMarshalText `json:"a"`
1106 }
1107 }{A: new(struct {
1108 A coverMarshalText `json:"a"`
1109 })},
1110 },
1111 {
1112 name: "PtrHeadMarshalTextZeroNotRootOmitEmpty",
1113 data: struct {
1114 A *struct {
1115 A coverMarshalText `json:"a,omitempty"`
1116 }
1117 }{A: new(struct {
1118 A coverMarshalText `json:"a,omitempty"`
1119 })},
1120 },
1121 {
1122 name: "PtrHeadMarshalTextZeroNotRootString",
1123 data: struct {
1124 A *struct {
1125 A coverMarshalText `json:"a,string"`
1126 }
1127 }{A: new(struct {
1128 A coverMarshalText `json:"a,string"`
1129 })},
1130 },
1131 {
1132 name: "PtrHeadPtrMarshalTextZeroNotRoot",
1133 data: struct {
1134 A *struct {
1135 A coverPtrMarshalText `json:"a"`
1136 }
1137 }{A: new(struct {
1138 A coverPtrMarshalText `json:"a"`
1139 })},
1140 },
1141 {
1142 name: "PtrHeadPtrMarshalTextZeroNotRootOmitEmpty",
1143 data: struct {
1144 A *struct {
1145 A coverPtrMarshalText `json:"a,omitempty"`
1146 }
1147 }{A: new(struct {
1148 A coverPtrMarshalText `json:"a,omitempty"`
1149 })},
1150 },
1151 {
1152 name: "PtrHeadPtrMarshalTextZeroNotRootString",
1153 data: struct {
1154 A *struct {
1155 A coverPtrMarshalText `json:"a,string"`
1156 }
1157 }{A: new(struct {
1158 A coverPtrMarshalText `json:"a,string"`
1159 })},
1160 },
1161
1162
1163 {
1164 name: "PtrHeadMarshalTextNotRoot",
1165 data: struct {
1166 A *struct {
1167 A coverMarshalText `json:"a"`
1168 }
1169 }{A: &(struct {
1170 A coverMarshalText `json:"a"`
1171 }{A: coverMarshalText{}})},
1172 },
1173 {
1174 name: "PtrHeadMarshalTextNotRootOmitEmpty",
1175 data: struct {
1176 A *struct {
1177 A coverMarshalText `json:"a,omitempty"`
1178 }
1179 }{A: &(struct {
1180 A coverMarshalText `json:"a,omitempty"`
1181 }{A: coverMarshalText{}})},
1182 },
1183 {
1184 name: "PtrHeadMarshalTextNotRootString",
1185 data: struct {
1186 A *struct {
1187 A coverMarshalText `json:"a,string"`
1188 }
1189 }{A: &(struct {
1190 A coverMarshalText `json:"a,string"`
1191 }{A: coverMarshalText{}})},
1192 },
1193 {
1194 name: "PtrHeadPtrMarshalTextNotRoot",
1195 data: struct {
1196 A *struct {
1197 A coverPtrMarshalText `json:"a"`
1198 }
1199 }{A: &(struct {
1200 A coverPtrMarshalText `json:"a"`
1201 }{A: coverPtrMarshalText{}})},
1202 },
1203 {
1204 name: "PtrHeadPtrMarshalTextNotRootOmitEmpty",
1205 data: struct {
1206 A *struct {
1207 A coverPtrMarshalText `json:"a,omitempty"`
1208 }
1209 }{A: &(struct {
1210 A coverPtrMarshalText `json:"a,omitempty"`
1211 }{A: coverPtrMarshalText{}})},
1212 },
1213 {
1214 name: "PtrHeadPtrMarshalTextNotRootString",
1215 data: struct {
1216 A *struct {
1217 A coverPtrMarshalText `json:"a,string"`
1218 }
1219 }{A: &(struct {
1220 A coverPtrMarshalText `json:"a,string"`
1221 }{A: coverPtrMarshalText{}})},
1222 },
1223
1224
1225 {
1226 name: "PtrHeadMarshalTextPtrNotRoot",
1227 data: struct {
1228 A *struct {
1229 A *coverMarshalText `json:"a"`
1230 }
1231 }{A: &(struct {
1232 A *coverMarshalText `json:"a"`
1233 }{A: &coverMarshalText{}})},
1234 },
1235 {
1236 name: "PtrHeadMarshalTextPtrNotRootOmitEmpty",
1237 data: struct {
1238 A *struct {
1239 A *coverMarshalText `json:"a,omitempty"`
1240 }
1241 }{A: &(struct {
1242 A *coverMarshalText `json:"a,omitempty"`
1243 }{A: &coverMarshalText{}})},
1244 },
1245 {
1246 name: "PtrHeadMarshalTextPtrNotRootString",
1247 data: struct {
1248 A *struct {
1249 A *coverMarshalText `json:"a,string"`
1250 }
1251 }{A: &(struct {
1252 A *coverMarshalText `json:"a,string"`
1253 }{A: &coverMarshalText{}})},
1254 },
1255 {
1256 name: "PtrHeadPtrMarshalTextPtrNotRoot",
1257 data: struct {
1258 A *struct {
1259 A *coverPtrMarshalText `json:"a"`
1260 }
1261 }{A: &(struct {
1262 A *coverPtrMarshalText `json:"a"`
1263 }{A: &coverPtrMarshalText{}})},
1264 },
1265 {
1266 name: "PtrHeadPtrMarshalTextPtrNotRootOmitEmpty",
1267 data: struct {
1268 A *struct {
1269 A *coverPtrMarshalText `json:"a,omitempty"`
1270 }
1271 }{A: &(struct {
1272 A *coverPtrMarshalText `json:"a,omitempty"`
1273 }{A: &coverPtrMarshalText{}})},
1274 },
1275 {
1276 name: "PtrHeadPtrMarshalTextPtrNotRootString",
1277 data: struct {
1278 A *struct {
1279 A *coverPtrMarshalText `json:"a,string"`
1280 }
1281 }{A: &(struct {
1282 A *coverPtrMarshalText `json:"a,string"`
1283 }{A: &coverPtrMarshalText{}})},
1284 },
1285
1286
1287 {
1288 name: "PtrHeadMarshalTextPtrNilNotRoot",
1289 data: struct {
1290 A *struct {
1291 A *coverMarshalText `json:"a"`
1292 }
1293 }{A: &(struct {
1294 A *coverMarshalText `json:"a"`
1295 }{A: nil})},
1296 },
1297 {
1298 name: "PtrHeadMarshalTextPtrNilNotRootOmitEmpty",
1299 data: struct {
1300 A *struct {
1301 A *coverMarshalText `json:"a,omitempty"`
1302 }
1303 }{A: &(struct {
1304 A *coverMarshalText `json:"a,omitempty"`
1305 }{A: nil})},
1306 },
1307 {
1308 name: "PtrHeadMarshalTextPtrNilNotRootString",
1309 data: struct {
1310 A *struct {
1311 A *coverMarshalText `json:"a,string"`
1312 }
1313 }{A: &(struct {
1314 A *coverMarshalText `json:"a,string"`
1315 }{A: nil})},
1316 },
1317 {
1318 name: "PtrHeadPtrMarshalTextPtrNilNotRoot",
1319 data: struct {
1320 A *struct {
1321 A *coverPtrMarshalText `json:"a"`
1322 }
1323 }{A: &(struct {
1324 A *coverPtrMarshalText `json:"a"`
1325 }{A: nil})},
1326 },
1327 {
1328 name: "PtrHeadPtrMarshalTextPtrNilNotRootOmitEmpty",
1329 data: struct {
1330 A *struct {
1331 A *coverPtrMarshalText `json:"a,omitempty"`
1332 }
1333 }{A: &(struct {
1334 A *coverPtrMarshalText `json:"a,omitempty"`
1335 }{A: nil})},
1336 },
1337 {
1338 name: "PtrHeadPtrMarshalTextPtrNilNotRootString",
1339 data: struct {
1340 A *struct {
1341 A *coverPtrMarshalText `json:"a,string"`
1342 }
1343 }{A: &(struct {
1344 A *coverPtrMarshalText `json:"a,string"`
1345 }{A: nil})},
1346 },
1347
1348
1349 {
1350 name: "PtrHeadMarshalTextNilNotRoot",
1351 data: struct {
1352 A *struct {
1353 A *coverMarshalText `json:"a"`
1354 }
1355 }{A: nil},
1356 },
1357 {
1358 name: "PtrHeadMarshalTextNilNotRootOmitEmpty",
1359 data: struct {
1360 A *struct {
1361 A *coverMarshalText `json:"a,omitempty"`
1362 } `json:",omitempty"`
1363 }{A: nil},
1364 },
1365 {
1366 name: "PtrHeadMarshalTextNilNotRootString",
1367 data: struct {
1368 A *struct {
1369 A *coverMarshalText `json:"a,string"`
1370 } `json:",string"`
1371 }{A: nil},
1372 },
1373 {
1374 name: "PtrHeadPtrMarshalTextNilNotRoot",
1375 data: struct {
1376 A *struct {
1377 A *coverPtrMarshalText `json:"a"`
1378 }
1379 }{A: nil},
1380 },
1381 {
1382 name: "PtrHeadPtrMarshalTextNilNotRootOmitEmpty",
1383 data: struct {
1384 A *struct {
1385 A *coverPtrMarshalText `json:"a,omitempty"`
1386 } `json:",omitempty"`
1387 }{A: nil},
1388 },
1389 {
1390 name: "PtrHeadPtrMarshalTextNilNotRootString",
1391 data: struct {
1392 A *struct {
1393 A *coverPtrMarshalText `json:"a,string"`
1394 } `json:",string"`
1395 }{A: nil},
1396 },
1397
1398
1399 {
1400 name: "HeadMarshalTextZeroMultiFieldsNotRoot",
1401 data: struct {
1402 A struct {
1403 A coverMarshalText `json:"a"`
1404 }
1405 B struct {
1406 B coverMarshalText `json:"b"`
1407 }
1408 }{},
1409 },
1410 {
1411 name: "HeadMarshalTextZeroMultiFieldsNotRootOmitEmpty",
1412 data: struct {
1413 A struct {
1414 A coverMarshalText `json:"a,omitempty"`
1415 }
1416 B struct {
1417 B coverMarshalText `json:"b,omitempty"`
1418 }
1419 }{},
1420 },
1421 {
1422 name: "HeadMarshalTextZeroMultiFieldsNotRootString",
1423 data: struct {
1424 A struct {
1425 A coverMarshalText `json:"a,string"`
1426 }
1427 B struct {
1428 B coverMarshalText `json:"b,string"`
1429 }
1430 }{},
1431 },
1432 {
1433 name: "HeadPtrMarshalTextZeroMultiFieldsNotRoot",
1434 data: struct {
1435 A struct {
1436 A coverPtrMarshalText `json:"a"`
1437 }
1438 B struct {
1439 B coverPtrMarshalText `json:"b"`
1440 }
1441 }{},
1442 },
1443 {
1444 name: "HeadPtrMarshalTextZeroMultiFieldsNotRootOmitEmpty",
1445 data: struct {
1446 A struct {
1447 A coverPtrMarshalText `json:"a,omitempty"`
1448 }
1449 B struct {
1450 B coverPtrMarshalText `json:"b,omitempty"`
1451 }
1452 }{},
1453 },
1454 {
1455 name: "HeadPtrMarshalTextZeroMultiFieldsNotRootString",
1456 data: struct {
1457 A struct {
1458 A coverPtrMarshalText `json:"a,string"`
1459 }
1460 B struct {
1461 B coverPtrMarshalText `json:"b,string"`
1462 }
1463 }{},
1464 },
1465
1466
1467 {
1468 name: "HeadMarshalTextMultiFieldsNotRoot",
1469 data: struct {
1470 A struct {
1471 A coverMarshalText `json:"a"`
1472 }
1473 B struct {
1474 B coverMarshalText `json:"b"`
1475 }
1476 }{A: struct {
1477 A coverMarshalText `json:"a"`
1478 }{A: coverMarshalText{}}, B: struct {
1479 B coverMarshalText `json:"b"`
1480 }{B: coverMarshalText{}}},
1481 },
1482 {
1483 name: "HeadMarshalTextMultiFieldsNotRootOmitEmpty",
1484 data: struct {
1485 A struct {
1486 A coverMarshalText `json:"a,omitempty"`
1487 }
1488 B struct {
1489 B coverMarshalText `json:"b,omitempty"`
1490 }
1491 }{A: struct {
1492 A coverMarshalText `json:"a,omitempty"`
1493 }{A: coverMarshalText{}}, B: struct {
1494 B coverMarshalText `json:"b,omitempty"`
1495 }{B: coverMarshalText{}}},
1496 },
1497 {
1498 name: "HeadMarshalTextMultiFieldsNotRootString",
1499 data: struct {
1500 A struct {
1501 A coverMarshalText `json:"a,string"`
1502 }
1503 B struct {
1504 B coverMarshalText `json:"b,string"`
1505 }
1506 }{A: struct {
1507 A coverMarshalText `json:"a,string"`
1508 }{A: coverMarshalText{}}, B: struct {
1509 B coverMarshalText `json:"b,string"`
1510 }{B: coverMarshalText{}}},
1511 },
1512 {
1513 name: "HeadPtrMarshalTextMultiFieldsNotRoot",
1514 data: struct {
1515 A struct {
1516 A coverPtrMarshalText `json:"a"`
1517 }
1518 B struct {
1519 B coverPtrMarshalText `json:"b"`
1520 }
1521 }{A: struct {
1522 A coverPtrMarshalText `json:"a"`
1523 }{A: coverPtrMarshalText{}}, B: struct {
1524 B coverPtrMarshalText `json:"b"`
1525 }{B: coverPtrMarshalText{}}},
1526 },
1527 {
1528 name: "HeadPtrMarshalTextMultiFieldsNotRootOmitEmpty",
1529 data: struct {
1530 A struct {
1531 A coverPtrMarshalText `json:"a,omitempty"`
1532 }
1533 B struct {
1534 B coverPtrMarshalText `json:"b,omitempty"`
1535 }
1536 }{A: struct {
1537 A coverPtrMarshalText `json:"a,omitempty"`
1538 }{A: coverPtrMarshalText{}}, B: struct {
1539 B coverPtrMarshalText `json:"b,omitempty"`
1540 }{B: coverPtrMarshalText{}}},
1541 },
1542 {
1543 name: "HeadPtrMarshalTextMultiFieldsNotRootString",
1544 data: struct {
1545 A struct {
1546 A coverPtrMarshalText `json:"a,string"`
1547 }
1548 B struct {
1549 B coverPtrMarshalText `json:"b,string"`
1550 }
1551 }{A: struct {
1552 A coverPtrMarshalText `json:"a,string"`
1553 }{A: coverPtrMarshalText{}}, B: struct {
1554 B coverPtrMarshalText `json:"b,string"`
1555 }{B: coverPtrMarshalText{}}},
1556 },
1557
1558
1559 {
1560 name: "HeadMarshalTextPtrMultiFieldsNotRoot",
1561 data: struct {
1562 A struct {
1563 A *coverMarshalText `json:"a"`
1564 }
1565 B struct {
1566 B *coverMarshalText `json:"b"`
1567 }
1568 }{A: struct {
1569 A *coverMarshalText `json:"a"`
1570 }{A: &coverMarshalText{}}, B: struct {
1571 B *coverMarshalText `json:"b"`
1572 }{B: &coverMarshalText{}}},
1573 },
1574 {
1575 name: "HeadMarshalTextPtrMultiFieldsNotRootOmitEmpty",
1576 data: struct {
1577 A struct {
1578 A *coverMarshalText `json:"a,omitempty"`
1579 }
1580 B struct {
1581 B *coverMarshalText `json:"b,omitempty"`
1582 }
1583 }{A: struct {
1584 A *coverMarshalText `json:"a,omitempty"`
1585 }{A: &coverMarshalText{}}, B: struct {
1586 B *coverMarshalText `json:"b,omitempty"`
1587 }{B: &coverMarshalText{}}},
1588 },
1589 {
1590 name: "HeadMarshalTextPtrMultiFieldsNotRootString",
1591 data: struct {
1592 A struct {
1593 A *coverMarshalText `json:"a,string"`
1594 }
1595 B struct {
1596 B *coverMarshalText `json:"b,string"`
1597 }
1598 }{A: struct {
1599 A *coverMarshalText `json:"a,string"`
1600 }{A: &coverMarshalText{}}, B: struct {
1601 B *coverMarshalText `json:"b,string"`
1602 }{B: &coverMarshalText{}}},
1603 },
1604 {
1605 name: "HeadPtrMarshalTextPtrMultiFieldsNotRoot",
1606 data: struct {
1607 A struct {
1608 A *coverPtrMarshalText `json:"a"`
1609 }
1610 B struct {
1611 B *coverPtrMarshalText `json:"b"`
1612 }
1613 }{A: struct {
1614 A *coverPtrMarshalText `json:"a"`
1615 }{A: &coverPtrMarshalText{}}, B: struct {
1616 B *coverPtrMarshalText `json:"b"`
1617 }{B: &coverPtrMarshalText{}}},
1618 },
1619 {
1620 name: "HeadPtrMarshalTextPtrMultiFieldsNotRootOmitEmpty",
1621 data: struct {
1622 A struct {
1623 A *coverPtrMarshalText `json:"a,omitempty"`
1624 }
1625 B struct {
1626 B *coverPtrMarshalText `json:"b,omitempty"`
1627 }
1628 }{A: struct {
1629 A *coverPtrMarshalText `json:"a,omitempty"`
1630 }{A: &coverPtrMarshalText{}}, B: struct {
1631 B *coverPtrMarshalText `json:"b,omitempty"`
1632 }{B: &coverPtrMarshalText{}}},
1633 },
1634 {
1635 name: "HeadPtrMarshalTextPtrMultiFieldsNotRootString",
1636 data: struct {
1637 A struct {
1638 A *coverPtrMarshalText `json:"a,string"`
1639 }
1640 B struct {
1641 B *coverPtrMarshalText `json:"b,string"`
1642 }
1643 }{A: struct {
1644 A *coverPtrMarshalText `json:"a,string"`
1645 }{A: &coverPtrMarshalText{}}, B: struct {
1646 B *coverPtrMarshalText `json:"b,string"`
1647 }{B: &coverPtrMarshalText{}}},
1648 },
1649
1650
1651 {
1652 name: "HeadMarshalTextPtrNilMultiFieldsNotRoot",
1653 data: struct {
1654 A struct {
1655 A *coverMarshalText `json:"a"`
1656 }
1657 B struct {
1658 B *coverMarshalText `json:"b"`
1659 }
1660 }{A: struct {
1661 A *coverMarshalText `json:"a"`
1662 }{A: nil}, B: struct {
1663 B *coverMarshalText `json:"b"`
1664 }{B: nil}},
1665 },
1666 {
1667 name: "HeadMarshalTextPtrNilMultiFieldsNotRootOmitEmpty",
1668 data: struct {
1669 A struct {
1670 A *coverMarshalText `json:"a,omitempty"`
1671 }
1672 B struct {
1673 B *coverMarshalText `json:"b,omitempty"`
1674 }
1675 }{A: struct {
1676 A *coverMarshalText `json:"a,omitempty"`
1677 }{A: nil}, B: struct {
1678 B *coverMarshalText `json:"b,omitempty"`
1679 }{B: nil}},
1680 },
1681 {
1682 name: "HeadMarshalTextPtrNilMultiFieldsNotRootString",
1683 data: struct {
1684 A struct {
1685 A *coverMarshalText `json:"a,string"`
1686 }
1687 B struct {
1688 B *coverMarshalText `json:"b,string"`
1689 }
1690 }{A: struct {
1691 A *coverMarshalText `json:"a,string"`
1692 }{A: nil}, B: struct {
1693 B *coverMarshalText `json:"b,string"`
1694 }{B: nil}},
1695 },
1696 {
1697 name: "HeadPtrMarshalTextPtrNilMultiFieldsNotRoot",
1698 data: struct {
1699 A struct {
1700 A *coverPtrMarshalText `json:"a"`
1701 }
1702 B struct {
1703 B *coverPtrMarshalText `json:"b"`
1704 }
1705 }{A: struct {
1706 A *coverPtrMarshalText `json:"a"`
1707 }{A: nil}, B: struct {
1708 B *coverPtrMarshalText `json:"b"`
1709 }{B: nil}},
1710 },
1711 {
1712 name: "HeadPtrMarshalTextPtrNilMultiFieldsNotRootOmitEmpty",
1713 data: struct {
1714 A struct {
1715 A *coverPtrMarshalText `json:"a,omitempty"`
1716 }
1717 B struct {
1718 B *coverPtrMarshalText `json:"b,omitempty"`
1719 }
1720 }{A: struct {
1721 A *coverPtrMarshalText `json:"a,omitempty"`
1722 }{A: nil}, B: struct {
1723 B *coverPtrMarshalText `json:"b,omitempty"`
1724 }{B: nil}},
1725 },
1726 {
1727 name: "HeadPtrMarshalTextPtrNilMultiFieldsNotRootString",
1728 data: struct {
1729 A struct {
1730 A *coverPtrMarshalText `json:"a,string"`
1731 }
1732 B struct {
1733 B *coverPtrMarshalText `json:"b,string"`
1734 }
1735 }{A: struct {
1736 A *coverPtrMarshalText `json:"a,string"`
1737 }{A: nil}, B: struct {
1738 B *coverPtrMarshalText `json:"b,string"`
1739 }{B: nil}},
1740 },
1741
1742
1743 {
1744 name: "PtrHeadMarshalTextZeroMultiFieldsNotRoot",
1745 data: &struct {
1746 A struct {
1747 A coverMarshalText `json:"a"`
1748 }
1749 B struct {
1750 B coverMarshalText `json:"b"`
1751 }
1752 }{},
1753 },
1754 {
1755 name: "PtrHeadMarshalTextZeroMultiFieldsNotRootOmitEmpty",
1756 data: &struct {
1757 A struct {
1758 A coverMarshalText `json:"a,omitempty"`
1759 }
1760 B struct {
1761 B coverMarshalText `json:"b,omitempty"`
1762 }
1763 }{},
1764 },
1765 {
1766 name: "PtrHeadMarshalTextZeroMultiFieldsNotRootString",
1767 data: &struct {
1768 A struct {
1769 A coverMarshalText `json:"a,string"`
1770 }
1771 B struct {
1772 B coverMarshalText `json:"b,string"`
1773 }
1774 }{},
1775 },
1776 {
1777 name: "PtrHeadPtrMarshalTextZeroMultiFieldsNotRoot",
1778 data: &struct {
1779 A struct {
1780 A coverPtrMarshalText `json:"a"`
1781 }
1782 B struct {
1783 B coverPtrMarshalText `json:"b"`
1784 }
1785 }{},
1786 },
1787 {
1788 name: "PtrHeadPtrMarshalTextZeroMultiFieldsNotRootOmitEmpty",
1789 data: &struct {
1790 A struct {
1791 A coverPtrMarshalText `json:"a,omitempty"`
1792 }
1793 B struct {
1794 B coverPtrMarshalText `json:"b,omitempty"`
1795 }
1796 }{},
1797 },
1798 {
1799 name: "PtrHeadPtrMarshalTextZeroMultiFieldsNotRootString",
1800 data: &struct {
1801 A struct {
1802 A coverPtrMarshalText `json:"a,string"`
1803 }
1804 B struct {
1805 B coverPtrMarshalText `json:"b,string"`
1806 }
1807 }{},
1808 },
1809
1810
1811 {
1812 name: "PtrHeadMarshalTextMultiFieldsNotRoot",
1813 data: &struct {
1814 A struct {
1815 A coverMarshalText `json:"a"`
1816 }
1817 B struct {
1818 B coverMarshalText `json:"b"`
1819 }
1820 }{A: struct {
1821 A coverMarshalText `json:"a"`
1822 }{A: coverMarshalText{}}, B: struct {
1823 B coverMarshalText `json:"b"`
1824 }{B: coverMarshalText{}}},
1825 },
1826 {
1827 name: "PtrHeadMarshalTextMultiFieldsNotRootOmitEmpty",
1828 data: &struct {
1829 A struct {
1830 A coverMarshalText `json:"a,omitempty"`
1831 }
1832 B struct {
1833 B coverMarshalText `json:"b,omitempty"`
1834 }
1835 }{A: struct {
1836 A coverMarshalText `json:"a,omitempty"`
1837 }{A: coverMarshalText{}}, B: struct {
1838 B coverMarshalText `json:"b,omitempty"`
1839 }{B: coverMarshalText{}}},
1840 },
1841 {
1842 name: "PtrHeadMarshalTextMultiFieldsNotRootString",
1843 data: &struct {
1844 A struct {
1845 A coverMarshalText `json:"a,string"`
1846 }
1847 B struct {
1848 B coverMarshalText `json:"b,string"`
1849 }
1850 }{A: struct {
1851 A coverMarshalText `json:"a,string"`
1852 }{A: coverMarshalText{}}, B: struct {
1853 B coverMarshalText `json:"b,string"`
1854 }{B: coverMarshalText{}}},
1855 },
1856 {
1857 name: "PtrHeadPtrMarshalTextMultiFieldsNotRoot",
1858 data: &struct {
1859 A struct {
1860 A coverPtrMarshalText `json:"a"`
1861 }
1862 B struct {
1863 B coverPtrMarshalText `json:"b"`
1864 }
1865 }{A: struct {
1866 A coverPtrMarshalText `json:"a"`
1867 }{A: coverPtrMarshalText{}}, B: struct {
1868 B coverPtrMarshalText `json:"b"`
1869 }{B: coverPtrMarshalText{}}},
1870 },
1871 {
1872 name: "PtrHeadPtrMarshalTextMultiFieldsNotRootOmitEmpty",
1873 data: &struct {
1874 A struct {
1875 A coverPtrMarshalText `json:"a,omitempty"`
1876 }
1877 B struct {
1878 B coverPtrMarshalText `json:"b,omitempty"`
1879 }
1880 }{A: struct {
1881 A coverPtrMarshalText `json:"a,omitempty"`
1882 }{A: coverPtrMarshalText{}}, B: struct {
1883 B coverPtrMarshalText `json:"b,omitempty"`
1884 }{B: coverPtrMarshalText{}}},
1885 },
1886 {
1887 name: "PtrHeadPtrMarshalTextMultiFieldsNotRootString",
1888 data: &struct {
1889 A struct {
1890 A coverPtrMarshalText `json:"a,string"`
1891 }
1892 B struct {
1893 B coverPtrMarshalText `json:"b,string"`
1894 }
1895 }{A: struct {
1896 A coverPtrMarshalText `json:"a,string"`
1897 }{A: coverPtrMarshalText{}}, B: struct {
1898 B coverPtrMarshalText `json:"b,string"`
1899 }{B: coverPtrMarshalText{}}},
1900 },
1901
1902
1903 {
1904 name: "PtrHeadMarshalTextPtrMultiFieldsNotRoot",
1905 data: &struct {
1906 A *struct {
1907 A *coverMarshalText `json:"a"`
1908 }
1909 B *struct {
1910 B *coverMarshalText `json:"b"`
1911 }
1912 }{A: &(struct {
1913 A *coverMarshalText `json:"a"`
1914 }{A: &coverMarshalText{}}), B: &(struct {
1915 B *coverMarshalText `json:"b"`
1916 }{B: &coverMarshalText{}})},
1917 },
1918 {
1919 name: "PtrHeadMarshalTextPtrMultiFieldsNotRootOmitEmpty",
1920 data: &struct {
1921 A *struct {
1922 A *coverMarshalText `json:"a,omitempty"`
1923 }
1924 B *struct {
1925 B *coverMarshalText `json:"b,omitempty"`
1926 }
1927 }{A: &(struct {
1928 A *coverMarshalText `json:"a,omitempty"`
1929 }{A: &coverMarshalText{}}), B: &(struct {
1930 B *coverMarshalText `json:"b,omitempty"`
1931 }{B: &coverMarshalText{}})},
1932 },
1933 {
1934 name: "PtrHeadMarshalTextPtrMultiFieldsNotRootString",
1935 data: &struct {
1936 A *struct {
1937 A *coverMarshalText `json:"a,string"`
1938 }
1939 B *struct {
1940 B *coverMarshalText `json:"b,string"`
1941 }
1942 }{A: &(struct {
1943 A *coverMarshalText `json:"a,string"`
1944 }{A: &coverMarshalText{}}), B: &(struct {
1945 B *coverMarshalText `json:"b,string"`
1946 }{B: &coverMarshalText{}})},
1947 },
1948 {
1949 name: "PtrHeadPtrMarshalTextPtrMultiFieldsNotRoot",
1950 data: &struct {
1951 A *struct {
1952 A *coverPtrMarshalText `json:"a"`
1953 }
1954 B *struct {
1955 B *coverPtrMarshalText `json:"b"`
1956 }
1957 }{A: &(struct {
1958 A *coverPtrMarshalText `json:"a"`
1959 }{A: &coverPtrMarshalText{}}), B: &(struct {
1960 B *coverPtrMarshalText `json:"b"`
1961 }{B: &coverPtrMarshalText{}})},
1962 },
1963 {
1964 name: "PtrHeadPtrMarshalTextPtrMultiFieldsNotRootOmitEmpty",
1965 data: &struct {
1966 A *struct {
1967 A *coverPtrMarshalText `json:"a,omitempty"`
1968 }
1969 B *struct {
1970 B *coverPtrMarshalText `json:"b,omitempty"`
1971 }
1972 }{A: &(struct {
1973 A *coverPtrMarshalText `json:"a,omitempty"`
1974 }{A: &coverPtrMarshalText{}}), B: &(struct {
1975 B *coverPtrMarshalText `json:"b,omitempty"`
1976 }{B: &coverPtrMarshalText{}})},
1977 },
1978 {
1979 name: "PtrHeadPtrMarshalTextPtrMultiFieldsNotRootString",
1980 data: &struct {
1981 A *struct {
1982 A *coverPtrMarshalText `json:"a,string"`
1983 }
1984 B *struct {
1985 B *coverPtrMarshalText `json:"b,string"`
1986 }
1987 }{A: &(struct {
1988 A *coverPtrMarshalText `json:"a,string"`
1989 }{A: &coverPtrMarshalText{}}), B: &(struct {
1990 B *coverPtrMarshalText `json:"b,string"`
1991 }{B: &coverPtrMarshalText{}})},
1992 },
1993
1994
1995 {
1996 name: "PtrHeadMarshalTextPtrNilMultiFieldsNotRoot",
1997 data: &struct {
1998 A *struct {
1999 A *coverMarshalText `json:"a"`
2000 }
2001 B *struct {
2002 B *coverMarshalText `json:"b"`
2003 }
2004 }{A: nil, B: nil},
2005 },
2006 {
2007 name: "PtrHeadMarshalTextPtrNilMultiFieldsNotRootOmitEmpty",
2008 data: &struct {
2009 A *struct {
2010 A *coverMarshalText `json:"a,omitempty"`
2011 } `json:",omitempty"`
2012 B *struct {
2013 B *coverMarshalText `json:"b,omitempty"`
2014 } `json:",omitempty"`
2015 }{A: nil, B: nil},
2016 },
2017 {
2018 name: "PtrHeadMarshalTextPtrNilMultiFieldsNotRootString",
2019 data: &struct {
2020 A *struct {
2021 A *coverMarshalText `json:"a,string"`
2022 } `json:",string"`
2023 B *struct {
2024 B *coverMarshalText `json:"b,string"`
2025 } `json:",string"`
2026 }{A: nil, B: nil},
2027 },
2028 {
2029 name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsNotRoot",
2030 data: &struct {
2031 A *struct {
2032 A *coverPtrMarshalText `json:"a"`
2033 }
2034 B *struct {
2035 B *coverPtrMarshalText `json:"b"`
2036 }
2037 }{A: nil, B: nil},
2038 },
2039 {
2040 name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsNotRootOmitEmpty",
2041 data: &struct {
2042 A *struct {
2043 A *coverPtrMarshalText `json:"a,omitempty"`
2044 } `json:",omitempty"`
2045 B *struct {
2046 B *coverPtrMarshalText `json:"b,omitempty"`
2047 } `json:",omitempty"`
2048 }{A: nil, B: nil},
2049 },
2050 {
2051 name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsNotRootString",
2052 data: &struct {
2053 A *struct {
2054 A *coverPtrMarshalText `json:"a,string"`
2055 } `json:",string"`
2056 B *struct {
2057 B *coverPtrMarshalText `json:"b,string"`
2058 } `json:",string"`
2059 }{A: nil, B: nil},
2060 },
2061
2062
2063 {
2064 name: "PtrHeadMarshalTextNilMultiFieldsNotRoot",
2065 data: (*struct {
2066 A *struct {
2067 A *coverMarshalText `json:"a"`
2068 }
2069 B *struct {
2070 B *coverMarshalText `json:"b"`
2071 }
2072 })(nil),
2073 },
2074 {
2075 name: "PtrHeadMarshalTextNilMultiFieldsNotRootOmitEmpty",
2076 data: (*struct {
2077 A *struct {
2078 A *coverMarshalText `json:"a,omitempty"`
2079 }
2080 B *struct {
2081 B *coverMarshalText `json:"b,omitempty"`
2082 }
2083 })(nil),
2084 },
2085 {
2086 name: "PtrHeadMarshalTextNilMultiFieldsNotRootString",
2087 data: (*struct {
2088 A *struct {
2089 A *coverMarshalText `json:"a,string"`
2090 }
2091 B *struct {
2092 B *coverMarshalText `json:"b,string"`
2093 }
2094 })(nil),
2095 },
2096 {
2097 name: "PtrHeadPtrMarshalTextNilMultiFieldsNotRoot",
2098 data: (*struct {
2099 A *struct {
2100 A *coverPtrMarshalText `json:"a"`
2101 }
2102 B *struct {
2103 B *coverPtrMarshalText `json:"b"`
2104 }
2105 })(nil),
2106 },
2107 {
2108 name: "PtrHeadPtrMarshalTextNilMultiFieldsNotRootOmitEmpty",
2109 data: (*struct {
2110 A *struct {
2111 A *coverPtrMarshalText `json:"a,omitempty"`
2112 }
2113 B *struct {
2114 B *coverPtrMarshalText `json:"b,omitempty"`
2115 }
2116 })(nil),
2117 },
2118 {
2119 name: "PtrHeadPtrMarshalTextNilMultiFieldsNotRootString",
2120 data: (*struct {
2121 A *struct {
2122 A *coverPtrMarshalText `json:"a,string"`
2123 }
2124 B *struct {
2125 B *coverPtrMarshalText `json:"b,string"`
2126 }
2127 })(nil),
2128 },
2129
2130
2131 {
2132 name: "PtrHeadMarshalTextDoubleMultiFieldsNotRoot",
2133 data: &struct {
2134 A *struct {
2135 A coverMarshalText `json:"a"`
2136 B coverMarshalText `json:"b"`
2137 }
2138 B *struct {
2139 A coverMarshalText `json:"a"`
2140 B coverMarshalText `json:"b"`
2141 }
2142 }{A: &(struct {
2143 A coverMarshalText `json:"a"`
2144 B coverMarshalText `json:"b"`
2145 }{A: coverMarshalText{}, B: coverMarshalText{}}), B: &(struct {
2146 A coverMarshalText `json:"a"`
2147 B coverMarshalText `json:"b"`
2148 }{A: coverMarshalText{}, B: coverMarshalText{}})},
2149 },
2150 {
2151 name: "PtrHeadMarshalTextDoubleMultiFieldsNotRootOmitEmpty",
2152 data: &struct {
2153 A *struct {
2154 A coverMarshalText `json:"a,omitempty"`
2155 B coverMarshalText `json:"b,omitempty"`
2156 }
2157 B *struct {
2158 A coverMarshalText `json:"a,omitempty"`
2159 B coverMarshalText `json:"b,omitempty"`
2160 }
2161 }{A: &(struct {
2162 A coverMarshalText `json:"a,omitempty"`
2163 B coverMarshalText `json:"b,omitempty"`
2164 }{A: coverMarshalText{}, B: coverMarshalText{}}), B: &(struct {
2165 A coverMarshalText `json:"a,omitempty"`
2166 B coverMarshalText `json:"b,omitempty"`
2167 }{A: coverMarshalText{}, B: coverMarshalText{}})},
2168 },
2169 {
2170 name: "PtrHeadMarshalTextDoubleMultiFieldsNotRootString",
2171 data: &struct {
2172 A *struct {
2173 A coverMarshalText `json:"a,string"`
2174 B coverMarshalText `json:"b,string"`
2175 }
2176 B *struct {
2177 A coverMarshalText `json:"a,string"`
2178 B coverMarshalText `json:"b,string"`
2179 }
2180 }{A: &(struct {
2181 A coverMarshalText `json:"a,string"`
2182 B coverMarshalText `json:"b,string"`
2183 }{A: coverMarshalText{}, B: coverMarshalText{}}), B: &(struct {
2184 A coverMarshalText `json:"a,string"`
2185 B coverMarshalText `json:"b,string"`
2186 }{A: coverMarshalText{}, B: coverMarshalText{}})},
2187 },
2188 {
2189 name: "PtrHeadPtrMarshalTextDoubleMultiFieldsNotRoot",
2190 data: &struct {
2191 A *struct {
2192 A coverPtrMarshalText `json:"a"`
2193 B coverPtrMarshalText `json:"b"`
2194 }
2195 B *struct {
2196 A coverPtrMarshalText `json:"a"`
2197 B coverPtrMarshalText `json:"b"`
2198 }
2199 }{A: &(struct {
2200 A coverPtrMarshalText `json:"a"`
2201 B coverPtrMarshalText `json:"b"`
2202 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}}), B: &(struct {
2203 A coverPtrMarshalText `json:"a"`
2204 B coverPtrMarshalText `json:"b"`
2205 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}})},
2206 },
2207 {
2208 name: "PtrHeadPtrMarshalTextDoubleMultiFieldsNotRootOmitEmpty",
2209 data: &struct {
2210 A *struct {
2211 A coverPtrMarshalText `json:"a,omitempty"`
2212 B coverPtrMarshalText `json:"b,omitempty"`
2213 }
2214 B *struct {
2215 A coverPtrMarshalText `json:"a,omitempty"`
2216 B coverPtrMarshalText `json:"b,omitempty"`
2217 }
2218 }{A: &(struct {
2219 A coverPtrMarshalText `json:"a,omitempty"`
2220 B coverPtrMarshalText `json:"b,omitempty"`
2221 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}}), B: &(struct {
2222 A coverPtrMarshalText `json:"a,omitempty"`
2223 B coverPtrMarshalText `json:"b,omitempty"`
2224 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}})},
2225 },
2226 {
2227 name: "PtrHeadPtrMarshalTextDoubleMultiFieldsNotRootString",
2228 data: &struct {
2229 A *struct {
2230 A coverPtrMarshalText `json:"a,string"`
2231 B coverPtrMarshalText `json:"b,string"`
2232 }
2233 B *struct {
2234 A coverPtrMarshalText `json:"a,string"`
2235 B coverPtrMarshalText `json:"b,string"`
2236 }
2237 }{A: &(struct {
2238 A coverPtrMarshalText `json:"a,string"`
2239 B coverPtrMarshalText `json:"b,string"`
2240 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}}), B: &(struct {
2241 A coverPtrMarshalText `json:"a,string"`
2242 B coverPtrMarshalText `json:"b,string"`
2243 }{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}})},
2244 },
2245
2246
2247 {
2248 name: "PtrHeadMarshalTextNilDoubleMultiFieldsNotRoot",
2249 data: &struct {
2250 A *struct {
2251 A coverMarshalText `json:"a"`
2252 B coverMarshalText `json:"b"`
2253 }
2254 B *struct {
2255 A coverMarshalText `json:"a"`
2256 B coverMarshalText `json:"b"`
2257 }
2258 }{A: nil, B: nil},
2259 },
2260 {
2261 name: "PtrHeadMarshalTextNilDoubleMultiFieldsNotRootOmitEmpty",
2262 data: &struct {
2263 A *struct {
2264 A coverMarshalText `json:"a,omitempty"`
2265 B coverMarshalText `json:"b,omitempty"`
2266 } `json:",omitempty"`
2267 B *struct {
2268 A coverMarshalText `json:"a,omitempty"`
2269 B coverMarshalText `json:"b,omitempty"`
2270 } `json:",omitempty"`
2271 }{A: nil, B: nil},
2272 },
2273 {
2274 name: "PtrHeadMarshalTextNilDoubleMultiFieldsNotRootString",
2275 data: &struct {
2276 A *struct {
2277 A coverMarshalText `json:"a,string"`
2278 B coverMarshalText `json:"b,string"`
2279 }
2280 B *struct {
2281 A coverMarshalText `json:"a,string"`
2282 B coverMarshalText `json:"b,string"`
2283 }
2284 }{A: nil, B: nil},
2285 },
2286 {
2287 name: "PtrHeadPtrMarshalTextNilDoubleMultiFieldsNotRoot",
2288 data: &struct {
2289 A *struct {
2290 A coverPtrMarshalText `json:"a"`
2291 B coverPtrMarshalText `json:"b"`
2292 }
2293 B *struct {
2294 A coverPtrMarshalText `json:"a"`
2295 B coverPtrMarshalText `json:"b"`
2296 }
2297 }{A: nil, B: nil},
2298 },
2299 {
2300 name: "PtrHeadPtrMarshalTextNilDoubleMultiFieldsNotRootOmitEmpty",
2301 data: &struct {
2302 A *struct {
2303 A coverPtrMarshalText `json:"a,omitempty"`
2304 B coverPtrMarshalText `json:"b,omitempty"`
2305 } `json:",omitempty"`
2306 B *struct {
2307 A coverPtrMarshalText `json:"a,omitempty"`
2308 B coverPtrMarshalText `json:"b,omitempty"`
2309 } `json:",omitempty"`
2310 }{A: nil, B: nil},
2311 },
2312 {
2313 name: "PtrHeadPtrMarshalTextNilDoubleMultiFieldsNotRootString",
2314 data: &struct {
2315 A *struct {
2316 A coverPtrMarshalText `json:"a,string"`
2317 B coverPtrMarshalText `json:"b,string"`
2318 }
2319 B *struct {
2320 A coverPtrMarshalText `json:"a,string"`
2321 B coverPtrMarshalText `json:"b,string"`
2322 }
2323 }{A: nil, B: nil},
2324 },
2325
2326
2327 {
2328 name: "PtrHeadMarshalTextNilDoubleMultiFieldsNotRoot",
2329 data: (*struct {
2330 A *struct {
2331 A coverMarshalText `json:"a"`
2332 B coverMarshalText `json:"b"`
2333 }
2334 B *struct {
2335 A coverMarshalText `json:"a"`
2336 B coverMarshalText `json:"b"`
2337 }
2338 })(nil),
2339 },
2340 {
2341 name: "PtrHeadMarshalTextNilDoubleMultiFieldsNotRootOmitEmpty",
2342 data: (*struct {
2343 A *struct {
2344 A coverMarshalText `json:"a,omitempty"`
2345 B coverMarshalText `json:"b,omitempty"`
2346 }
2347 B *struct {
2348 A coverMarshalText `json:"a,omitempty"`
2349 B coverMarshalText `json:"b,omitempty"`
2350 }
2351 })(nil),
2352 },
2353 {
2354 name: "PtrHeadMarshalTextNilDoubleMultiFieldsNotRootString",
2355 data: (*struct {
2356 A *struct {
2357 A coverMarshalText `json:"a,string"`
2358 B coverMarshalText `json:"b,string"`
2359 }
2360 B *struct {
2361 A coverMarshalText `json:"a,string"`
2362 B coverMarshalText `json:"b,string"`
2363 }
2364 })(nil),
2365 },
2366 {
2367 name: "PtrHeadPtrMarshalTextNilDoubleMultiFieldsNotRoot",
2368 data: (*struct {
2369 A *struct {
2370 A coverPtrMarshalText `json:"a"`
2371 B coverPtrMarshalText `json:"b"`
2372 }
2373 B *struct {
2374 A coverPtrMarshalText `json:"a"`
2375 B coverPtrMarshalText `json:"b"`
2376 }
2377 })(nil),
2378 },
2379 {
2380 name: "PtrHeadPtrMarshalTextNilDoubleMultiFieldsNotRootOmitEmpty",
2381 data: (*struct {
2382 A *struct {
2383 A coverPtrMarshalText `json:"a,omitempty"`
2384 B coverPtrMarshalText `json:"b,omitempty"`
2385 }
2386 B *struct {
2387 A coverPtrMarshalText `json:"a,omitempty"`
2388 B coverPtrMarshalText `json:"b,omitempty"`
2389 }
2390 })(nil),
2391 },
2392 {
2393 name: "PtrHeadPtrMarshalTextNilDoubleMultiFieldsNotRootString",
2394 data: (*struct {
2395 A *struct {
2396 A coverPtrMarshalText `json:"a,string"`
2397 B coverPtrMarshalText `json:"b,string"`
2398 }
2399 B *struct {
2400 A coverPtrMarshalText `json:"a,string"`
2401 B coverPtrMarshalText `json:"b,string"`
2402 }
2403 })(nil),
2404 },
2405
2406
2407 {
2408 name: "PtrHeadMarshalTextPtrDoubleMultiFieldsNotRoot",
2409 data: &struct {
2410 A *struct {
2411 A *coverMarshalText `json:"a"`
2412 B *coverMarshalText `json:"b"`
2413 }
2414 B *struct {
2415 A *coverMarshalText `json:"a"`
2416 B *coverMarshalText `json:"b"`
2417 }
2418 }{A: &(struct {
2419 A *coverMarshalText `json:"a"`
2420 B *coverMarshalText `json:"b"`
2421 }{A: &coverMarshalText{}, B: &coverMarshalText{}}), B: &(struct {
2422 A *coverMarshalText `json:"a"`
2423 B *coverMarshalText `json:"b"`
2424 }{A: nil, B: nil})},
2425 },
2426 {
2427 name: "PtrHeadMarshalTextPtrDoubleMultiFieldsNotRootOmitEmpty",
2428 data: &struct {
2429 A *struct {
2430 A *coverMarshalText `json:"a,omitempty"`
2431 B *coverMarshalText `json:"b,omitempty"`
2432 }
2433 B *struct {
2434 A *coverMarshalText `json:"a,omitempty"`
2435 B *coverMarshalText `json:"b,omitempty"`
2436 }
2437 }{A: &(struct {
2438 A *coverMarshalText `json:"a,omitempty"`
2439 B *coverMarshalText `json:"b,omitempty"`
2440 }{A: &coverMarshalText{}, B: &coverMarshalText{}}), B: &(struct {
2441 A *coverMarshalText `json:"a,omitempty"`
2442 B *coverMarshalText `json:"b,omitempty"`
2443 }{A: nil, B: nil})},
2444 },
2445 {
2446 name: "PtrHeadMarshalTextPtrDoubleMultiFieldsNotRootString",
2447 data: &struct {
2448 A *struct {
2449 A *coverMarshalText `json:"a,string"`
2450 B *coverMarshalText `json:"b,string"`
2451 }
2452 B *struct {
2453 A *coverMarshalText `json:"a,string"`
2454 B *coverMarshalText `json:"b,string"`
2455 }
2456 }{A: &(struct {
2457 A *coverMarshalText `json:"a,string"`
2458 B *coverMarshalText `json:"b,string"`
2459 }{A: &coverMarshalText{}, B: &coverMarshalText{}}), B: &(struct {
2460 A *coverMarshalText `json:"a,string"`
2461 B *coverMarshalText `json:"b,string"`
2462 }{A: nil, B: nil})},
2463 },
2464 {
2465 name: "PtrHeadPtrMarshalTextPtrDoubleMultiFieldsNotRoot",
2466 data: &struct {
2467 A *struct {
2468 A *coverPtrMarshalText `json:"a"`
2469 B *coverPtrMarshalText `json:"b"`
2470 }
2471 B *struct {
2472 A *coverPtrMarshalText `json:"a"`
2473 B *coverPtrMarshalText `json:"b"`
2474 }
2475 }{A: &(struct {
2476 A *coverPtrMarshalText `json:"a"`
2477 B *coverPtrMarshalText `json:"b"`
2478 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}}), B: &(struct {
2479 A *coverPtrMarshalText `json:"a"`
2480 B *coverPtrMarshalText `json:"b"`
2481 }{A: nil, B: nil})},
2482 },
2483 {
2484 name: "PtrHeadPtrMarshalTextPtrDoubleMultiFieldsNotRootOmitEmpty",
2485 data: &struct {
2486 A *struct {
2487 A *coverPtrMarshalText `json:"a,omitempty"`
2488 B *coverPtrMarshalText `json:"b,omitempty"`
2489 }
2490 B *struct {
2491 A *coverPtrMarshalText `json:"a,omitempty"`
2492 B *coverPtrMarshalText `json:"b,omitempty"`
2493 }
2494 }{A: &(struct {
2495 A *coverPtrMarshalText `json:"a,omitempty"`
2496 B *coverPtrMarshalText `json:"b,omitempty"`
2497 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}}), B: &(struct {
2498 A *coverPtrMarshalText `json:"a,omitempty"`
2499 B *coverPtrMarshalText `json:"b,omitempty"`
2500 }{A: nil, B: nil})},
2501 },
2502 {
2503 name: "PtrHeadPtrMarshalTextPtrDoubleMultiFieldsNotRootString",
2504 data: &struct {
2505 A *struct {
2506 A *coverPtrMarshalText `json:"a,string"`
2507 B *coverPtrMarshalText `json:"b,string"`
2508 }
2509 B *struct {
2510 A *coverPtrMarshalText `json:"a,string"`
2511 B *coverPtrMarshalText `json:"b,string"`
2512 }
2513 }{A: &(struct {
2514 A *coverPtrMarshalText `json:"a,string"`
2515 B *coverPtrMarshalText `json:"b,string"`
2516 }{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}}), B: &(struct {
2517 A *coverPtrMarshalText `json:"a,string"`
2518 B *coverPtrMarshalText `json:"b,string"`
2519 }{A: nil, B: nil})},
2520 },
2521
2522
2523 {
2524 name: "PtrHeadMarshalTextPtrNilDoubleMultiFieldsNotRoot",
2525 data: &struct {
2526 A *struct {
2527 A *coverMarshalText `json:"a"`
2528 B *coverMarshalText `json:"b"`
2529 }
2530 B *struct {
2531 A *coverMarshalText `json:"a"`
2532 B *coverMarshalText `json:"b"`
2533 }
2534 }{A: nil, B: nil},
2535 },
2536 {
2537 name: "PtrHeadMarshalTextPtrNilDoubleMultiFieldsNotRootOmitEmpty",
2538 data: &struct {
2539 A *struct {
2540 A *coverMarshalText `json:"a,omitempty"`
2541 B *coverMarshalText `json:"b,omitempty"`
2542 } `json:",omitempty"`
2543 B *struct {
2544 A *coverMarshalText `json:"a,omitempty"`
2545 B *coverMarshalText `json:"b,omitempty"`
2546 } `json:",omitempty"`
2547 }{A: nil, B: nil},
2548 },
2549 {
2550 name: "PtrHeadMarshalTextPtrNilDoubleMultiFieldsNotRootString",
2551 data: &struct {
2552 A *struct {
2553 A *coverMarshalText `json:"a,string"`
2554 B *coverMarshalText `json:"b,string"`
2555 }
2556 B *struct {
2557 A *coverMarshalText `json:"a,string"`
2558 B *coverMarshalText `json:"b,string"`
2559 }
2560 }{A: nil, B: nil},
2561 },
2562 {
2563 name: "PtrHeadPtrMarshalTextPtrNilDoubleMultiFieldsNotRoot",
2564 data: &struct {
2565 A *struct {
2566 A *coverPtrMarshalText `json:"a"`
2567 B *coverPtrMarshalText `json:"b"`
2568 }
2569 B *struct {
2570 A *coverPtrMarshalText `json:"a"`
2571 B *coverPtrMarshalText `json:"b"`
2572 }
2573 }{A: nil, B: nil},
2574 },
2575 {
2576 name: "PtrHeadPtrMarshalTextPtrNilDoubleMultiFieldsNotRootOmitEmpty",
2577 data: &struct {
2578 A *struct {
2579 A *coverPtrMarshalText `json:"a,omitempty"`
2580 B *coverPtrMarshalText `json:"b,omitempty"`
2581 } `json:",omitempty"`
2582 B *struct {
2583 A *coverPtrMarshalText `json:"a,omitempty"`
2584 B *coverPtrMarshalText `json:"b,omitempty"`
2585 } `json:",omitempty"`
2586 }{A: nil, B: nil},
2587 },
2588 {
2589 name: "PtrHeadPtrMarshalTextPtrNilDoubleMultiFieldsNotRootString",
2590 data: &struct {
2591 A *struct {
2592 A *coverPtrMarshalText `json:"a,string"`
2593 B *coverPtrMarshalText `json:"b,string"`
2594 }
2595 B *struct {
2596 A *coverPtrMarshalText `json:"a,string"`
2597 B *coverPtrMarshalText `json:"b,string"`
2598 }
2599 }{A: nil, B: nil},
2600 },
2601
2602
2603 {
2604 name: "PtrHeadMarshalTextPtrNilDoubleMultiFieldsNotRoot",
2605 data: (*struct {
2606 A *struct {
2607 A *coverMarshalText `json:"a"`
2608 B *coverMarshalText `json:"b"`
2609 }
2610 B *struct {
2611 A *coverMarshalText `json:"a"`
2612 B *coverMarshalText `json:"b"`
2613 }
2614 })(nil),
2615 },
2616 {
2617 name: "PtrHeadMarshalTextPtrNilDoubleMultiFieldsNotRootOmitEmpty",
2618 data: (*struct {
2619 A *struct {
2620 A *coverMarshalText `json:"a,omitempty"`
2621 B *coverMarshalText `json:"b,omitempty"`
2622 }
2623 B *struct {
2624 A *coverMarshalText `json:"a,omitempty"`
2625 B *coverMarshalText `json:"b,omitempty"`
2626 }
2627 })(nil),
2628 },
2629 {
2630 name: "PtrHeadMarshalTextPtrNilDoubleMultiFieldsNotRootString",
2631 data: (*struct {
2632 A *struct {
2633 A *coverMarshalText `json:"a,string"`
2634 B *coverMarshalText `json:"b,string"`
2635 }
2636 B *struct {
2637 A *coverMarshalText `json:"a,string"`
2638 B *coverMarshalText `json:"b,string"`
2639 }
2640 })(nil),
2641 },
2642 {
2643 name: "PtrHeadPtrMarshalTextPtrNilDoubleMultiFieldsNotRoot",
2644 data: (*struct {
2645 A *struct {
2646 A *coverPtrMarshalText `json:"a"`
2647 B *coverPtrMarshalText `json:"b"`
2648 }
2649 B *struct {
2650 A *coverPtrMarshalText `json:"a"`
2651 B *coverPtrMarshalText `json:"b"`
2652 }
2653 })(nil),
2654 },
2655 {
2656 name: "PtrHeadPtrMarshalTextPtrNilDoubleMultiFieldsNotRootOmitEmpty",
2657 data: (*struct {
2658 A *struct {
2659 A *coverPtrMarshalText `json:"a,omitempty"`
2660 B *coverPtrMarshalText `json:"b,omitempty"`
2661 }
2662 B *struct {
2663 A *coverPtrMarshalText `json:"a,omitempty"`
2664 B *coverPtrMarshalText `json:"b,omitempty"`
2665 }
2666 })(nil),
2667 },
2668 {
2669 name: "PtrHeadPtrMarshalTextPtrNilDoubleMultiFieldsNotRootString",
2670 data: (*struct {
2671 A *struct {
2672 A *coverPtrMarshalText `json:"a,string"`
2673 B *coverPtrMarshalText `json:"b,string"`
2674 }
2675 B *struct {
2676 A *coverPtrMarshalText `json:"a,string"`
2677 B *coverPtrMarshalText `json:"b,string"`
2678 }
2679 })(nil),
2680 },
2681
2682
2683 {
2684 name: "AnonymousHeadMarshalText",
2685 data: struct {
2686 structMarshalText
2687 B coverMarshalText `json:"b"`
2688 }{
2689 structMarshalText: structMarshalText{A: coverMarshalText{}},
2690 B: coverMarshalText{},
2691 },
2692 },
2693 {
2694 name: "AnonymousHeadMarshalTextOmitEmpty",
2695 data: struct {
2696 structMarshalTextOmitEmpty
2697 B coverMarshalText `json:"b,omitempty"`
2698 }{
2699 structMarshalTextOmitEmpty: structMarshalTextOmitEmpty{A: coverMarshalText{}},
2700 B: coverMarshalText{},
2701 },
2702 },
2703 {
2704 name: "AnonymousHeadMarshalTextString",
2705 data: struct {
2706 structMarshalTextString
2707 B coverMarshalText `json:"b,string"`
2708 }{
2709 structMarshalTextString: structMarshalTextString{A: coverMarshalText{}},
2710 B: coverMarshalText{},
2711 },
2712 },
2713 {
2714 name: "AnonymousHeadPtrMarshalText",
2715 data: struct {
2716 structPtrMarshalText
2717 B coverPtrMarshalText `json:"b"`
2718 }{
2719 structPtrMarshalText: structPtrMarshalText{A: coverPtrMarshalText{}},
2720 B: coverPtrMarshalText{},
2721 },
2722 },
2723 {
2724 name: "AnonymousHeadPtrMarshalTextOmitEmpty",
2725 data: struct {
2726 structPtrMarshalTextOmitEmpty
2727 B coverPtrMarshalText `json:"b,omitempty"`
2728 }{
2729 structPtrMarshalTextOmitEmpty: structPtrMarshalTextOmitEmpty{A: coverPtrMarshalText{}},
2730 B: coverPtrMarshalText{},
2731 },
2732 },
2733 {
2734 name: "AnonymousHeadPtrMarshalTextString",
2735 data: struct {
2736 structPtrMarshalTextString
2737 B coverPtrMarshalText `json:"b,string"`
2738 }{
2739 structPtrMarshalTextString: structPtrMarshalTextString{A: coverPtrMarshalText{}},
2740 B: coverPtrMarshalText{},
2741 },
2742 },
2743
2744
2745 {
2746 name: "PtrAnonymousHeadMarshalText",
2747 data: struct {
2748 *structMarshalText
2749 B coverMarshalText `json:"b"`
2750 }{
2751 structMarshalText: &structMarshalText{A: coverMarshalText{}},
2752 B: coverMarshalText{},
2753 },
2754 },
2755 {
2756 name: "PtrAnonymousHeadMarshalTextOmitEmpty",
2757 data: struct {
2758 *structMarshalTextOmitEmpty
2759 B coverMarshalText `json:"b,omitempty"`
2760 }{
2761 structMarshalTextOmitEmpty: &structMarshalTextOmitEmpty{A: coverMarshalText{}},
2762 B: coverMarshalText{},
2763 },
2764 },
2765 {
2766 name: "PtrAnonymousHeadMarshalTextString",
2767 data: struct {
2768 *structMarshalTextString
2769 B coverMarshalText `json:"b,string"`
2770 }{
2771 structMarshalTextString: &structMarshalTextString{A: coverMarshalText{}},
2772 B: coverMarshalText{},
2773 },
2774 },
2775 {
2776 name: "PtrAnonymousHeadPtrMarshalText",
2777 data: struct {
2778 *structPtrMarshalText
2779 B coverPtrMarshalText `json:"b"`
2780 }{
2781 structPtrMarshalText: &structPtrMarshalText{A: coverPtrMarshalText{}},
2782 B: coverPtrMarshalText{},
2783 },
2784 },
2785 {
2786 name: "PtrAnonymousHeadPtrMarshalTextOmitEmpty",
2787 data: struct {
2788 *structPtrMarshalTextOmitEmpty
2789 B coverPtrMarshalText `json:"b,omitempty"`
2790 }{
2791 structPtrMarshalTextOmitEmpty: &structPtrMarshalTextOmitEmpty{A: coverPtrMarshalText{}},
2792 B: coverPtrMarshalText{},
2793 },
2794 },
2795 {
2796 name: "PtrAnonymousHeadPtrMarshalTextString",
2797 data: struct {
2798 *structPtrMarshalTextString
2799 B coverPtrMarshalText `json:"b,string"`
2800 }{
2801 structPtrMarshalTextString: &structPtrMarshalTextString{A: coverPtrMarshalText{}},
2802 B: coverPtrMarshalText{},
2803 },
2804 },
2805
2806
2807 {
2808 name: "PtrAnonymousHeadMarshalTextNil",
2809 data: struct {
2810 *structMarshalText
2811 B coverMarshalText `json:"b"`
2812 }{
2813 structMarshalText: &structMarshalText{A: coverMarshalText{}},
2814 B: coverMarshalText{},
2815 },
2816 },
2817 {
2818 name: "PtrAnonymousHeadMarshalTextNilOmitEmpty",
2819 data: struct {
2820 *structMarshalTextOmitEmpty
2821 B coverMarshalText `json:"b,omitempty"`
2822 }{
2823 structMarshalTextOmitEmpty: &structMarshalTextOmitEmpty{A: coverMarshalText{}},
2824 B: coverMarshalText{},
2825 },
2826 },
2827 {
2828 name: "PtrAnonymousHeadMarshalTextNilString",
2829 data: struct {
2830 *structMarshalTextString
2831 B coverMarshalText `json:"b,string"`
2832 }{
2833 structMarshalTextString: &structMarshalTextString{A: coverMarshalText{}},
2834 B: coverMarshalText{},
2835 },
2836 },
2837 {
2838 name: "PtrAnonymousHeadPtrMarshalTextNil",
2839 data: struct {
2840 *structPtrMarshalText
2841 B coverPtrMarshalText `json:"b"`
2842 }{
2843 structPtrMarshalText: &structPtrMarshalText{A: coverPtrMarshalText{}},
2844 B: coverPtrMarshalText{},
2845 },
2846 },
2847 {
2848 name: "PtrAnonymousHeadPtrMarshalTextNilOmitEmpty",
2849 data: struct {
2850 *structPtrMarshalTextOmitEmpty
2851 B coverPtrMarshalText `json:"b,omitempty"`
2852 }{
2853 structPtrMarshalTextOmitEmpty: &structPtrMarshalTextOmitEmpty{A: coverPtrMarshalText{}},
2854 B: coverPtrMarshalText{},
2855 },
2856 },
2857 {
2858 name: "PtrAnonymousHeadPtrMarshalTextNilString",
2859 data: struct {
2860 *structPtrMarshalTextString
2861 B coverPtrMarshalText `json:"b,string"`
2862 }{
2863 structPtrMarshalTextString: &structPtrMarshalTextString{A: coverPtrMarshalText{}},
2864 B: coverPtrMarshalText{},
2865 },
2866 },
2867
2868
2869 {
2870 name: "NilPtrAnonymousHeadMarshalText",
2871 data: struct {
2872 *structMarshalText
2873 B coverMarshalText `json:"b"`
2874 }{
2875 structMarshalText: nil,
2876 B: coverMarshalText{},
2877 },
2878 },
2879 {
2880 name: "NilPtrAnonymousHeadMarshalTextOmitEmpty",
2881 data: struct {
2882 *structMarshalTextOmitEmpty
2883 B coverMarshalText `json:"b,omitempty"`
2884 }{
2885 structMarshalTextOmitEmpty: nil,
2886 B: coverMarshalText{},
2887 },
2888 },
2889 {
2890 name: "NilPtrAnonymousHeadMarshalTextString",
2891 data: struct {
2892 *structMarshalTextString
2893 B coverMarshalText `json:"b,string"`
2894 }{
2895 structMarshalTextString: nil,
2896 B: coverMarshalText{},
2897 },
2898 },
2899 {
2900 name: "NilPtrAnonymousHeadPtrMarshalText",
2901 data: struct {
2902 *structPtrMarshalText
2903 B coverPtrMarshalText `json:"b"`
2904 }{
2905 structPtrMarshalText: nil,
2906 B: coverPtrMarshalText{},
2907 },
2908 },
2909 {
2910 name: "NilPtrAnonymousHeadPtrMarshalTextOmitEmpty",
2911 data: struct {
2912 *structPtrMarshalTextOmitEmpty
2913 B coverPtrMarshalText `json:"b,omitempty"`
2914 }{
2915 structPtrMarshalTextOmitEmpty: nil,
2916 B: coverPtrMarshalText{},
2917 },
2918 },
2919 {
2920 name: "NilPtrAnonymousHeadPtrMarshalTextString",
2921 data: struct {
2922 *structPtrMarshalTextString
2923 B coverPtrMarshalText `json:"b,string"`
2924 }{
2925 structPtrMarshalTextString: nil,
2926 B: coverPtrMarshalText{},
2927 },
2928 },
2929
2930
2931 {
2932 name: "AnonymousHeadMarshalTextPtr",
2933 data: struct {
2934 structMarshalTextPtr
2935 B *coverMarshalText `json:"b"`
2936 }{
2937 structMarshalTextPtr: structMarshalTextPtr{A: &coverMarshalText{}},
2938 B: nil,
2939 },
2940 },
2941 {
2942 name: "AnonymousHeadMarshalTextPtrOmitEmpty",
2943 data: struct {
2944 structMarshalTextPtrOmitEmpty
2945 B *coverMarshalText `json:"b,omitempty"`
2946 }{
2947 structMarshalTextPtrOmitEmpty: structMarshalTextPtrOmitEmpty{A: &coverMarshalText{}},
2948 B: nil,
2949 },
2950 },
2951 {
2952 name: "AnonymousHeadMarshalTextPtrString",
2953 data: struct {
2954 structMarshalTextPtrString
2955 B *coverMarshalText `json:"b,string"`
2956 }{
2957 structMarshalTextPtrString: structMarshalTextPtrString{A: &coverMarshalText{}},
2958 B: nil,
2959 },
2960 },
2961 {
2962 name: "AnonymousHeadPtrMarshalTextPtr",
2963 data: struct {
2964 structPtrMarshalTextPtr
2965 B *coverPtrMarshalText `json:"b"`
2966 }{
2967 structPtrMarshalTextPtr: structPtrMarshalTextPtr{A: &coverPtrMarshalText{}},
2968 B: nil,
2969 },
2970 },
2971 {
2972 name: "AnonymousHeadPtrMarshalTextPtrOmitEmpty",
2973 data: struct {
2974 structPtrMarshalTextPtrOmitEmpty
2975 B *coverPtrMarshalText `json:"b,omitempty"`
2976 }{
2977 structPtrMarshalTextPtrOmitEmpty: structPtrMarshalTextPtrOmitEmpty{A: &coverPtrMarshalText{}},
2978 B: nil,
2979 },
2980 },
2981 {
2982 name: "AnonymousHeadPtrMarshalTextPtrString",
2983 data: struct {
2984 structPtrMarshalTextPtrString
2985 B *coverPtrMarshalText `json:"b,string"`
2986 }{
2987 structPtrMarshalTextPtrString: structPtrMarshalTextPtrString{A: &coverPtrMarshalText{}},
2988 B: nil,
2989 },
2990 },
2991
2992
2993 {
2994 name: "AnonymousHeadMarshalTextPtrNil",
2995 data: struct {
2996 structMarshalTextPtr
2997 B *coverMarshalText `json:"b"`
2998 }{
2999 structMarshalTextPtr: structMarshalTextPtr{A: nil},
3000 B: &coverMarshalText{},
3001 },
3002 },
3003 {
3004 name: "AnonymousHeadMarshalTextPtrNilOmitEmpty",
3005 data: struct {
3006 structMarshalTextPtrOmitEmpty
3007 B *coverMarshalText `json:"b,omitempty"`
3008 }{
3009 structMarshalTextPtrOmitEmpty: structMarshalTextPtrOmitEmpty{A: nil},
3010 B: &coverMarshalText{},
3011 },
3012 },
3013 {
3014 name: "AnonymousHeadMarshalTextPtrNilString",
3015 data: struct {
3016 structMarshalTextPtrString
3017 B *coverMarshalText `json:"b,string"`
3018 }{
3019 structMarshalTextPtrString: structMarshalTextPtrString{A: nil},
3020 B: &coverMarshalText{},
3021 },
3022 },
3023 {
3024 name: "AnonymousHeadPtrMarshalTextPtrNil",
3025 data: struct {
3026 structPtrMarshalTextPtr
3027 B *coverPtrMarshalText `json:"b"`
3028 }{
3029 structPtrMarshalTextPtr: structPtrMarshalTextPtr{A: nil},
3030 B: &coverPtrMarshalText{},
3031 },
3032 },
3033 {
3034 name: "AnonymousHeadPtrMarshalTextPtrNilOmitEmpty",
3035 data: struct {
3036 structPtrMarshalTextPtrOmitEmpty
3037 B *coverPtrMarshalText `json:"b,omitempty"`
3038 }{
3039 structPtrMarshalTextPtrOmitEmpty: structPtrMarshalTextPtrOmitEmpty{A: nil},
3040 B: &coverPtrMarshalText{},
3041 },
3042 },
3043 {
3044 name: "AnonymousHeadPtrMarshalTextPtrNilString",
3045 data: struct {
3046 structPtrMarshalTextPtrString
3047 B *coverPtrMarshalText `json:"b,string"`
3048 }{
3049 structPtrMarshalTextPtrString: structPtrMarshalTextPtrString{A: nil},
3050 B: &coverPtrMarshalText{},
3051 },
3052 },
3053
3054
3055 {
3056 name: "PtrAnonymousHeadMarshalTextPtr",
3057 data: struct {
3058 *structMarshalTextPtr
3059 B *coverMarshalText `json:"b"`
3060 }{
3061 structMarshalTextPtr: &structMarshalTextPtr{A: &coverMarshalText{}},
3062 B: nil,
3063 },
3064 },
3065 {
3066 name: "PtrAnonymousHeadMarshalTextPtrOmitEmpty",
3067 data: struct {
3068 *structMarshalTextPtrOmitEmpty
3069 B *coverMarshalText `json:"b,omitempty"`
3070 }{
3071 structMarshalTextPtrOmitEmpty: &structMarshalTextPtrOmitEmpty{A: &coverMarshalText{}},
3072 B: nil,
3073 },
3074 },
3075 {
3076 name: "PtrAnonymousHeadMarshalTextPtrString",
3077 data: struct {
3078 *structMarshalTextPtrString
3079 B *coverMarshalText `json:"b,string"`
3080 }{
3081 structMarshalTextPtrString: &structMarshalTextPtrString{A: &coverMarshalText{}},
3082 B: nil,
3083 },
3084 },
3085 {
3086 name: "PtrAnonymousHeadPtrMarshalTextPtr",
3087 data: struct {
3088 *structPtrMarshalTextPtr
3089 B *coverPtrMarshalText `json:"b"`
3090 }{
3091 structPtrMarshalTextPtr: &structPtrMarshalTextPtr{A: &coverPtrMarshalText{}},
3092 B: nil,
3093 },
3094 },
3095 {
3096 name: "PtrAnonymousHeadPtrMarshalTextPtrOmitEmpty",
3097 data: struct {
3098 *structPtrMarshalTextPtrOmitEmpty
3099 B *coverPtrMarshalText `json:"b,omitempty"`
3100 }{
3101 structPtrMarshalTextPtrOmitEmpty: &structPtrMarshalTextPtrOmitEmpty{A: &coverPtrMarshalText{}},
3102 B: nil,
3103 },
3104 },
3105 {
3106 name: "PtrAnonymousHeadPtrMarshalTextPtrString",
3107 data: struct {
3108 *structPtrMarshalTextPtrString
3109 B *coverPtrMarshalText `json:"b,string"`
3110 }{
3111 structPtrMarshalTextPtrString: &structPtrMarshalTextPtrString{A: &coverPtrMarshalText{}},
3112 B: nil,
3113 },
3114 },
3115
3116
3117 {
3118 name: "NilPtrAnonymousHeadMarshalTextPtr",
3119 data: struct {
3120 *structMarshalTextPtr
3121 B *coverMarshalText `json:"b"`
3122 }{
3123 structMarshalTextPtr: nil,
3124 B: &coverMarshalText{},
3125 },
3126 },
3127 {
3128 name: "NilPtrAnonymousHeadMarshalTextPtrOmitEmpty",
3129 data: struct {
3130 *structMarshalTextPtrOmitEmpty
3131 B *coverMarshalText `json:"b,omitempty"`
3132 }{
3133 structMarshalTextPtrOmitEmpty: nil,
3134 B: &coverMarshalText{},
3135 },
3136 },
3137 {
3138 name: "NilPtrAnonymousHeadMarshalTextPtrString",
3139 data: struct {
3140 *structMarshalTextPtrString
3141 B *coverMarshalText `json:"b,string"`
3142 }{
3143 structMarshalTextPtrString: nil,
3144 B: &coverMarshalText{},
3145 },
3146 },
3147 {
3148 name: "NilPtrAnonymousHeadPtrMarshalTextPtr",
3149 data: struct {
3150 *structPtrMarshalTextPtr
3151 B *coverPtrMarshalText `json:"b"`
3152 }{
3153 structPtrMarshalTextPtr: nil,
3154 B: &coverPtrMarshalText{},
3155 },
3156 },
3157 {
3158 name: "NilPtrAnonymousHeadPtrMarshalTextPtrOmitEmpty",
3159 data: struct {
3160 *structPtrMarshalTextPtrOmitEmpty
3161 B *coverPtrMarshalText `json:"b,omitempty"`
3162 }{
3163 structPtrMarshalTextPtrOmitEmpty: nil,
3164 B: &coverPtrMarshalText{},
3165 },
3166 },
3167 {
3168 name: "NilPtrAnonymousHeadPtrMarshalTextPtrString",
3169 data: struct {
3170 *structPtrMarshalTextPtrString
3171 B *coverPtrMarshalText `json:"b,string"`
3172 }{
3173 structPtrMarshalTextPtrString: nil,
3174 B: &coverPtrMarshalText{},
3175 },
3176 },
3177
3178
3179 {
3180 name: "AnonymousHeadMarshalTextOnly",
3181 data: struct {
3182 structMarshalText
3183 }{
3184 structMarshalText: structMarshalText{A: coverMarshalText{}},
3185 },
3186 },
3187 {
3188 name: "AnonymousHeadMarshalTextOnlyOmitEmpty",
3189 data: struct {
3190 structMarshalTextOmitEmpty
3191 }{
3192 structMarshalTextOmitEmpty: structMarshalTextOmitEmpty{A: coverMarshalText{}},
3193 },
3194 },
3195 {
3196 name: "AnonymousHeadMarshalTextOnlyString",
3197 data: struct {
3198 structMarshalTextString
3199 }{
3200 structMarshalTextString: structMarshalTextString{A: coverMarshalText{}},
3201 },
3202 },
3203 {
3204 name: "AnonymousHeadPtrMarshalTextOnly",
3205 data: struct {
3206 structPtrMarshalText
3207 }{
3208 structPtrMarshalText: structPtrMarshalText{A: coverPtrMarshalText{}},
3209 },
3210 },
3211 {
3212 name: "AnonymousHeadPtrMarshalTextOnlyOmitEmpty",
3213 data: struct {
3214 structPtrMarshalTextOmitEmpty
3215 }{
3216 structPtrMarshalTextOmitEmpty: structPtrMarshalTextOmitEmpty{A: coverPtrMarshalText{}},
3217 },
3218 },
3219 {
3220 name: "AnonymousHeadPtrMarshalTextOnlyString",
3221 data: struct {
3222 structPtrMarshalTextString
3223 }{
3224 structPtrMarshalTextString: structPtrMarshalTextString{A: coverPtrMarshalText{}},
3225 },
3226 },
3227
3228
3229 {
3230 name: "PtrAnonymousHeadMarshalTextOnly",
3231 data: struct {
3232 *structMarshalText
3233 }{
3234 structMarshalText: &structMarshalText{A: coverMarshalText{}},
3235 },
3236 },
3237 {
3238 name: "PtrAnonymousHeadMarshalTextOnlyOmitEmpty",
3239 data: struct {
3240 *structMarshalTextOmitEmpty
3241 }{
3242 structMarshalTextOmitEmpty: &structMarshalTextOmitEmpty{A: coverMarshalText{}},
3243 },
3244 },
3245 {
3246 name: "PtrAnonymousHeadMarshalTextOnlyString",
3247 data: struct {
3248 *structMarshalTextString
3249 }{
3250 structMarshalTextString: &structMarshalTextString{A: coverMarshalText{}},
3251 },
3252 },
3253 {
3254 name: "PtrAnonymousHeadPtrMarshalTextOnly",
3255 data: struct {
3256 *structPtrMarshalText
3257 }{
3258 structPtrMarshalText: &structPtrMarshalText{A: coverPtrMarshalText{}},
3259 },
3260 },
3261 {
3262 name: "PtrAnonymousHeadPtrMarshalTextOnlyOmitEmpty",
3263 data: struct {
3264 *structPtrMarshalTextOmitEmpty
3265 }{
3266 structPtrMarshalTextOmitEmpty: &structPtrMarshalTextOmitEmpty{A: coverPtrMarshalText{}},
3267 },
3268 },
3269 {
3270 name: "PtrAnonymousHeadPtrMarshalTextOnlyString",
3271 data: struct {
3272 *structPtrMarshalTextString
3273 }{
3274 structPtrMarshalTextString: &structPtrMarshalTextString{A: coverPtrMarshalText{}},
3275 },
3276 },
3277
3278
3279 {
3280 name: "NilPtrAnonymousHeadMarshalTextOnly",
3281 data: struct {
3282 *structMarshalText
3283 }{
3284 structMarshalText: nil,
3285 },
3286 },
3287 {
3288 name: "NilPtrAnonymousHeadMarshalTextOnlyOmitEmpty",
3289 data: struct {
3290 *structMarshalTextOmitEmpty
3291 }{
3292 structMarshalTextOmitEmpty: nil,
3293 },
3294 },
3295 {
3296 name: "NilPtrAnonymousHeadMarshalTextOnlyString",
3297 data: struct {
3298 *structMarshalTextString
3299 }{
3300 structMarshalTextString: nil,
3301 },
3302 },
3303 {
3304 name: "NilPtrAnonymousHeadPtrMarshalTextOnly",
3305 data: struct {
3306 *structPtrMarshalText
3307 }{
3308 structPtrMarshalText: nil,
3309 },
3310 },
3311 {
3312 name: "NilPtrAnonymousHeadPtrMarshalTextOnlyOmitEmpty",
3313 data: struct {
3314 *structPtrMarshalTextOmitEmpty
3315 }{
3316 structPtrMarshalTextOmitEmpty: nil,
3317 },
3318 },
3319 {
3320 name: "NilPtrAnonymousHeadPtrMarshalTextOnlyString",
3321 data: struct {
3322 *structPtrMarshalTextString
3323 }{
3324 structPtrMarshalTextString: nil,
3325 },
3326 },
3327
3328
3329 {
3330 name: "AnonymousHeadMarshalTextPtrOnly",
3331 data: struct {
3332 structMarshalTextPtr
3333 }{
3334 structMarshalTextPtr: structMarshalTextPtr{A: &coverMarshalText{}},
3335 },
3336 },
3337 {
3338 name: "AnonymousHeadMarshalTextPtrOnlyOmitEmpty",
3339 data: struct {
3340 structMarshalTextPtrOmitEmpty
3341 }{
3342 structMarshalTextPtrOmitEmpty: structMarshalTextPtrOmitEmpty{A: &coverMarshalText{}},
3343 },
3344 },
3345 {
3346 name: "AnonymousHeadMarshalTextPtrOnlyString",
3347 data: struct {
3348 structMarshalTextPtrString
3349 }{
3350 structMarshalTextPtrString: structMarshalTextPtrString{A: &coverMarshalText{}},
3351 },
3352 },
3353 {
3354 name: "AnonymousHeadPtrMarshalTextPtrOnly",
3355 data: struct {
3356 structPtrMarshalTextPtr
3357 }{
3358 structPtrMarshalTextPtr: structPtrMarshalTextPtr{A: &coverPtrMarshalText{}},
3359 },
3360 },
3361 {
3362 name: "AnonymousHeadPtrMarshalTextPtrOnlyOmitEmpty",
3363 data: struct {
3364 structPtrMarshalTextPtrOmitEmpty
3365 }{
3366 structPtrMarshalTextPtrOmitEmpty: structPtrMarshalTextPtrOmitEmpty{A: &coverPtrMarshalText{}},
3367 },
3368 },
3369 {
3370 name: "AnonymousHeadPtrMarshalTextPtrOnlyString",
3371 data: struct {
3372 structPtrMarshalTextPtrString
3373 }{
3374 structPtrMarshalTextPtrString: structPtrMarshalTextPtrString{A: &coverPtrMarshalText{}},
3375 },
3376 },
3377
3378
3379 {
3380 name: "AnonymousHeadMarshalTextPtrNilOnly",
3381 data: struct {
3382 structMarshalTextPtr
3383 }{
3384 structMarshalTextPtr: structMarshalTextPtr{A: nil},
3385 },
3386 },
3387 {
3388 name: "AnonymousHeadMarshalTextPtrNilOnlyOmitEmpty",
3389 data: struct {
3390 structMarshalTextPtrOmitEmpty
3391 }{
3392 structMarshalTextPtrOmitEmpty: structMarshalTextPtrOmitEmpty{A: nil},
3393 },
3394 },
3395 {
3396 name: "AnonymousHeadMarshalTextPtrNilOnlyString",
3397 data: struct {
3398 structMarshalTextPtrString
3399 }{
3400 structMarshalTextPtrString: structMarshalTextPtrString{A: nil},
3401 },
3402 },
3403 {
3404 name: "AnonymousHeadPtrMarshalTextPtrNilOnly",
3405 data: struct {
3406 structPtrMarshalTextPtr
3407 }{
3408 structPtrMarshalTextPtr: structPtrMarshalTextPtr{A: nil},
3409 },
3410 },
3411 {
3412 name: "AnonymousHeadPtrMarshalTextPtrNilOnlyOmitEmpty",
3413 data: struct {
3414 structPtrMarshalTextPtrOmitEmpty
3415 }{
3416 structPtrMarshalTextPtrOmitEmpty: structPtrMarshalTextPtrOmitEmpty{A: nil},
3417 },
3418 },
3419 {
3420 name: "AnonymousHeadPtrMarshalTextPtrNilOnlyString",
3421 data: struct {
3422 structPtrMarshalTextPtrString
3423 }{
3424 structPtrMarshalTextPtrString: structPtrMarshalTextPtrString{A: nil},
3425 },
3426 },
3427
3428
3429 {
3430 name: "PtrAnonymousHeadMarshalTextPtrOnly",
3431 data: struct {
3432 *structMarshalTextPtr
3433 }{
3434 structMarshalTextPtr: &structMarshalTextPtr{A: &coverMarshalText{}},
3435 },
3436 },
3437 {
3438 name: "PtrAnonymousHeadMarshalTextPtrOnlyOmitEmpty",
3439 data: struct {
3440 *structMarshalTextPtrOmitEmpty
3441 }{
3442 structMarshalTextPtrOmitEmpty: &structMarshalTextPtrOmitEmpty{A: &coverMarshalText{}},
3443 },
3444 },
3445 {
3446 name: "PtrAnonymousHeadMarshalTextPtrOnlyString",
3447 data: struct {
3448 *structMarshalTextPtrString
3449 }{
3450 structMarshalTextPtrString: &structMarshalTextPtrString{A: &coverMarshalText{}},
3451 },
3452 },
3453 {
3454 name: "PtrAnonymousHeadPtrMarshalTextPtrOnly",
3455 data: struct {
3456 *structPtrMarshalTextPtr
3457 }{
3458 structPtrMarshalTextPtr: &structPtrMarshalTextPtr{A: &coverPtrMarshalText{}},
3459 },
3460 },
3461 {
3462 name: "PtrAnonymousHeadPtrMarshalTextPtrOnlyOmitEmpty",
3463 data: struct {
3464 *structPtrMarshalTextPtrOmitEmpty
3465 }{
3466 structPtrMarshalTextPtrOmitEmpty: &structPtrMarshalTextPtrOmitEmpty{A: &coverPtrMarshalText{}},
3467 },
3468 },
3469 {
3470 name: "PtrAnonymousHeadPtrMarshalTextPtrOnlyString",
3471 data: struct {
3472 *structPtrMarshalTextPtrString
3473 }{
3474 structPtrMarshalTextPtrString: &structPtrMarshalTextPtrString{A: &coverPtrMarshalText{}},
3475 },
3476 },
3477
3478
3479 {
3480 name: "NilPtrAnonymousHeadMarshalTextPtrOnly",
3481 data: struct {
3482 *structMarshalTextPtr
3483 }{
3484 structMarshalTextPtr: nil,
3485 },
3486 },
3487 {
3488 name: "NilPtrAnonymousHeadMarshalTextPtrOnlyOmitEmpty",
3489 data: struct {
3490 *structMarshalTextPtrOmitEmpty
3491 }{
3492 structMarshalTextPtrOmitEmpty: nil,
3493 },
3494 },
3495 {
3496 name: "NilPtrAnonymousHeadMarshalTextPtrOnlyString",
3497 data: struct {
3498 *structMarshalTextPtrString
3499 }{
3500 structMarshalTextPtrString: nil,
3501 },
3502 },
3503 {
3504 name: "NilPtrAnonymousHeadPtrMarshalTextPtrOnly",
3505 data: struct {
3506 *structPtrMarshalTextPtr
3507 }{
3508 structPtrMarshalTextPtr: nil,
3509 },
3510 },
3511 {
3512 name: "NilPtrAnonymousHeadPtrMarshalTextPtrOnlyOmitEmpty",
3513 data: struct {
3514 *structPtrMarshalTextPtrOmitEmpty
3515 }{
3516 structPtrMarshalTextPtrOmitEmpty: nil,
3517 },
3518 },
3519 {
3520 name: "NilPtrAnonymousHeadPtrMarshalTextPtrOnlyString",
3521 data: struct {
3522 *structPtrMarshalTextPtrString
3523 }{
3524 structPtrMarshalTextPtrString: nil,
3525 },
3526 },
3527 }
3528 for _, test := range tests {
3529 for _, indent := range []bool{true, false} {
3530 for _, htmlEscape := range []bool{true, false} {
3531 t.Run(fmt.Sprintf("%s_indent_%t_escape_%t", test.name, indent, htmlEscape), func(t *testing.T) {
3532 var buf bytes.Buffer
3533 enc := json.NewEncoder(&buf)
3534 enc.SetEscapeHTML(htmlEscape)
3535 if indent {
3536 enc.SetIndent("", " ")
3537 }
3538 if err := enc.Encode(test.data); err != nil {
3539 t.Fatalf("%s(htmlEscape:%v,indent:%v): %+v: %s", test.name, htmlEscape, indent, test.data, err)
3540 }
3541 stdresult := encodeByEncodingJSON(test.data, indent, htmlEscape)
3542 if buf.String() != stdresult {
3543 t.Errorf("%s(htmlEscape:%v,indent:%v): doesn't compatible with encoding/json. expected %q but got %q", test.name, htmlEscape, indent, stdresult, buf.String())
3544 }
3545 })
3546 }
3547 }
3548 }
3549 }
3550
View as plain text