git.gammaspectra.live/P2Pool/go-json@v0.99.0/test/cover/cover_uint64_test.go (about)

     1  package json_test
     2  
     3  import (
     4  	"bytes"
     5  	"fmt"
     6  	"testing"
     7  
     8  	"git.gammaspectra.live/P2Pool/go-json"
     9  )
    10  
    11  func TestCoverUint64(t *testing.T) {
    12  	type structUint64 struct {
    13  		A uint64 `json:"a"`
    14  	}
    15  	type structUint64OmitEmpty struct {
    16  		A uint64 `json:"a,omitempty"`
    17  	}
    18  	type structUint64String struct {
    19  		A uint64 `json:"a,string"`
    20  	}
    21  
    22  	type structUint64Ptr struct {
    23  		A *uint64 `json:"a"`
    24  	}
    25  	type structUint64PtrOmitEmpty struct {
    26  		A *uint64 `json:"a,omitempty"`
    27  	}
    28  	type structUint64PtrString struct {
    29  		A *uint64 `json:"a,string"`
    30  	}
    31  
    32  	tests := []struct {
    33  		name string
    34  		data interface{}
    35  	}{
    36  		{
    37  			name: "Uint64",
    38  			data: uint64(10),
    39  		},
    40  		{
    41  			name: "Uint64Ptr",
    42  			data: uint64ptr(10),
    43  		},
    44  		{
    45  			name: "Uint64Ptr3",
    46  			data: uint64ptr3(10),
    47  		},
    48  		{
    49  			name: "Uint64PtrNil",
    50  			data: (*uint64)(nil),
    51  		},
    52  		{
    53  			name: "Uint64Ptr3Nil",
    54  			data: (***uint64)(nil),
    55  		},
    56  
    57  		// HeadUint64Zero
    58  		{
    59  			name: "HeadUint64Zero",
    60  			data: struct {
    61  				A uint64 `json:"a"`
    62  			}{},
    63  		},
    64  		{
    65  			name: "HeadUint64ZeroOmitEmpty",
    66  			data: struct {
    67  				A uint64 `json:"a,omitempty"`
    68  			}{},
    69  		},
    70  		{
    71  			name: "HeadUint64ZeroString",
    72  			data: struct {
    73  				A uint64 `json:"a,string"`
    74  			}{},
    75  		},
    76  
    77  		// HeadUint64
    78  		{
    79  			name: "HeadUint64",
    80  			data: struct {
    81  				A uint64 `json:"a"`
    82  			}{A: 1},
    83  		},
    84  		{
    85  			name: "HeadUint64OmitEmpty",
    86  			data: struct {
    87  				A uint64 `json:"a,omitempty"`
    88  			}{A: 1},
    89  		},
    90  		{
    91  			name: "HeadUint64String",
    92  			data: struct {
    93  				A uint64 `json:"a,string"`
    94  			}{A: 1},
    95  		},
    96  
    97  		// HeadUint64Ptr
    98  		{
    99  			name: "HeadUint64Ptr",
   100  			data: struct {
   101  				A *uint64 `json:"a"`
   102  			}{A: uint64ptr(1)},
   103  		},
   104  		{
   105  			name: "HeadUint64PtrOmitEmpty",
   106  			data: struct {
   107  				A *uint64 `json:"a,omitempty"`
   108  			}{A: uint64ptr(1)},
   109  		},
   110  		{
   111  			name: "HeadUint64PtrString",
   112  			data: struct {
   113  				A *uint64 `json:"a,string"`
   114  			}{A: uint64ptr(1)},
   115  		},
   116  
   117  		// HeadUint64PtrNil
   118  		{
   119  			name: "HeadUint64PtrNil",
   120  			data: struct {
   121  				A *uint64 `json:"a"`
   122  			}{A: nil},
   123  		},
   124  		{
   125  			name: "HeadUint64PtrNilOmitEmpty",
   126  			data: struct {
   127  				A *uint64 `json:"a,omitempty"`
   128  			}{A: nil},
   129  		},
   130  		{
   131  			name: "HeadUint64PtrNilString",
   132  			data: struct {
   133  				A *uint64 `json:"a,string"`
   134  			}{A: nil},
   135  		},
   136  
   137  		// PtrHeadUint64Zero
   138  		{
   139  			name: "PtrHeadUint64Zero",
   140  			data: &struct {
   141  				A uint64 `json:"a"`
   142  			}{},
   143  		},
   144  		{
   145  			name: "PtrHeadUint64ZeroOmitEmpty",
   146  			data: &struct {
   147  				A uint64 `json:"a,omitempty"`
   148  			}{},
   149  		},
   150  		{
   151  			name: "PtrHeadUint64ZeroString",
   152  			data: &struct {
   153  				A uint64 `json:"a,string"`
   154  			}{},
   155  		},
   156  
   157  		// PtrHeadUint64
   158  		{
   159  			name: "PtrHeadUint64",
   160  			data: &struct {
   161  				A uint64 `json:"a"`
   162  			}{A: 1},
   163  		},
   164  		{
   165  			name: "PtrHeadUint64OmitEmpty",
   166  			data: &struct {
   167  				A uint64 `json:"a,omitempty"`
   168  			}{A: 1},
   169  		},
   170  		{
   171  			name: "PtrHeadUint64String",
   172  			data: &struct {
   173  				A uint64 `json:"a,string"`
   174  			}{A: 1},
   175  		},
   176  
   177  		// PtrHeadUint64Ptr
   178  		{
   179  			name: "PtrHeadUint64Ptr",
   180  			data: &struct {
   181  				A *uint64 `json:"a"`
   182  			}{A: uint64ptr(1)},
   183  		},
   184  		{
   185  			name: "PtrHeadUint64PtrOmitEmpty",
   186  			data: &struct {
   187  				A *uint64 `json:"a,omitempty"`
   188  			}{A: uint64ptr(1)},
   189  		},
   190  		{
   191  			name: "PtrHeadUint64PtrString",
   192  			data: &struct {
   193  				A *uint64 `json:"a,string"`
   194  			}{A: uint64ptr(1)},
   195  		},
   196  
   197  		// PtrHeadUint64PtrNil
   198  		{
   199  			name: "PtrHeadUint64PtrNil",
   200  			data: &struct {
   201  				A *uint64 `json:"a"`
   202  			}{A: nil},
   203  		},
   204  		{
   205  			name: "PtrHeadUint64PtrNilOmitEmpty",
   206  			data: &struct {
   207  				A *uint64 `json:"a,omitempty"`
   208  			}{A: nil},
   209  		},
   210  		{
   211  			name: "PtrHeadUint64PtrNilString",
   212  			data: &struct {
   213  				A *uint64 `json:"a,string"`
   214  			}{A: nil},
   215  		},
   216  
   217  		// PtrHeadUint64Nil
   218  		{
   219  			name: "PtrHeadUint64Nil",
   220  			data: (*struct {
   221  				A *uint64 `json:"a"`
   222  			})(nil),
   223  		},
   224  		{
   225  			name: "PtrHeadUint64NilOmitEmpty",
   226  			data: (*struct {
   227  				A *uint64 `json:"a,omitempty"`
   228  			})(nil),
   229  		},
   230  		{
   231  			name: "PtrHeadUint64NilString",
   232  			data: (*struct {
   233  				A *uint64 `json:"a,string"`
   234  			})(nil),
   235  		},
   236  
   237  		// HeadUint64ZeroMultiFields
   238  		{
   239  			name: "HeadUint64ZeroMultiFields",
   240  			data: struct {
   241  				A uint64 `json:"a"`
   242  				B uint64 `json:"b"`
   243  				C uint64 `json:"c"`
   244  			}{},
   245  		},
   246  		{
   247  			name: "HeadUint64ZeroMultiFieldsOmitEmpty",
   248  			data: struct {
   249  				A uint64 `json:"a,omitempty"`
   250  				B uint64 `json:"b,omitempty"`
   251  				C uint64 `json:"c,omitempty"`
   252  			}{},
   253  		},
   254  		{
   255  			name: "HeadUint64ZeroMultiFields",
   256  			data: struct {
   257  				A uint64 `json:"a,string"`
   258  				B uint64 `json:"b,string"`
   259  				C uint64 `json:"c,string"`
   260  			}{},
   261  		},
   262  
   263  		// HeadUint64MultiFields
   264  		{
   265  			name: "HeadUint64MultiFields",
   266  			data: struct {
   267  				A uint64 `json:"a"`
   268  				B uint64 `json:"b"`
   269  				C uint64 `json:"c"`
   270  			}{A: 1, B: 2, C: 3},
   271  		},
   272  		{
   273  			name: "HeadUint64MultiFieldsOmitEmpty",
   274  			data: struct {
   275  				A uint64 `json:"a,omitempty"`
   276  				B uint64 `json:"b,omitempty"`
   277  				C uint64 `json:"c,omitempty"`
   278  			}{A: 1, B: 2, C: 3},
   279  		},
   280  		{
   281  			name: "HeadUint64MultiFieldsString",
   282  			data: struct {
   283  				A uint64 `json:"a,string"`
   284  				B uint64 `json:"b,string"`
   285  				C uint64 `json:"c,string"`
   286  			}{A: 1, B: 2, C: 3},
   287  		},
   288  
   289  		// HeadUint64PtrMultiFields
   290  		{
   291  			name: "HeadUint64PtrMultiFields",
   292  			data: struct {
   293  				A *uint64 `json:"a"`
   294  				B *uint64 `json:"b"`
   295  				C *uint64 `json:"c"`
   296  			}{A: uint64ptr(1), B: uint64ptr(2), C: uint64ptr(3)},
   297  		},
   298  		{
   299  			name: "HeadUint64PtrMultiFieldsOmitEmpty",
   300  			data: struct {
   301  				A *uint64 `json:"a,omitempty"`
   302  				B *uint64 `json:"b,omitempty"`
   303  				C *uint64 `json:"c,omitempty"`
   304  			}{A: uint64ptr(1), B: uint64ptr(2), C: uint64ptr(3)},
   305  		},
   306  		{
   307  			name: "HeadUint64PtrMultiFieldsString",
   308  			data: struct {
   309  				A *uint64 `json:"a,string"`
   310  				B *uint64 `json:"b,string"`
   311  				C *uint64 `json:"c,string"`
   312  			}{A: uint64ptr(1), B: uint64ptr(2), C: uint64ptr(3)},
   313  		},
   314  
   315  		// HeadUint64PtrNilMultiFields
   316  		{
   317  			name: "HeadUint64PtrNilMultiFields",
   318  			data: struct {
   319  				A *uint64 `json:"a"`
   320  				B *uint64 `json:"b"`
   321  				C *uint64 `json:"c"`
   322  			}{A: nil, B: nil, C: nil},
   323  		},
   324  		{
   325  			name: "HeadUint64PtrNilMultiFieldsOmitEmpty",
   326  			data: struct {
   327  				A *uint64 `json:"a,omitempty"`
   328  				B *uint64 `json:"b,omitempty"`
   329  				C *uint64 `json:"c,omitempty"`
   330  			}{A: nil, B: nil, C: nil},
   331  		},
   332  		{
   333  			name: "HeadUint64PtrNilMultiFieldsString",
   334  			data: struct {
   335  				A *uint64 `json:"a,string"`
   336  				B *uint64 `json:"b,string"`
   337  				C *uint64 `json:"c,string"`
   338  			}{A: nil, B: nil, C: nil},
   339  		},
   340  
   341  		// PtrHeadUint64ZeroMultiFields
   342  		{
   343  			name: "PtrHeadUint64ZeroMultiFields",
   344  			data: &struct {
   345  				A uint64 `json:"a"`
   346  				B uint64 `json:"b"`
   347  			}{},
   348  		},
   349  		{
   350  			name: "PtrHeadUint64ZeroMultiFieldsOmitEmpty",
   351  			data: &struct {
   352  				A uint64 `json:"a,omitempty"`
   353  				B uint64 `json:"b,omitempty"`
   354  			}{},
   355  		},
   356  		{
   357  			name: "PtrHeadUint64ZeroMultiFieldsString",
   358  			data: &struct {
   359  				A uint64 `json:"a,string"`
   360  				B uint64 `json:"b,string"`
   361  			}{},
   362  		},
   363  
   364  		// PtrHeadUint64MultiFields
   365  		{
   366  			name: "PtrHeadUint64MultiFields",
   367  			data: &struct {
   368  				A uint64 `json:"a"`
   369  				B uint64 `json:"b"`
   370  			}{A: 1, B: 2},
   371  		},
   372  		{
   373  			name: "PtrHeadUint64MultiFieldsOmitEmpty",
   374  			data: &struct {
   375  				A uint64 `json:"a,omitempty"`
   376  				B uint64 `json:"b,omitempty"`
   377  			}{A: 1, B: 2},
   378  		},
   379  		{
   380  			name: "PtrHeadUint64MultiFieldsString",
   381  			data: &struct {
   382  				A uint64 `json:"a,string"`
   383  				B uint64 `json:"b,string"`
   384  			}{A: 1, B: 2},
   385  		},
   386  
   387  		// PtrHeadUint64PtrMultiFields
   388  		{
   389  			name: "PtrHeadUint64PtrMultiFields",
   390  			data: &struct {
   391  				A *uint64 `json:"a"`
   392  				B *uint64 `json:"b"`
   393  			}{A: uint64ptr(1), B: uint64ptr(2)},
   394  		},
   395  		{
   396  			name: "PtrHeadUint64PtrMultiFieldsOmitEmpty",
   397  			data: &struct {
   398  				A *uint64 `json:"a,omitempty"`
   399  				B *uint64 `json:"b,omitempty"`
   400  			}{A: uint64ptr(1), B: uint64ptr(2)},
   401  		},
   402  		{
   403  			name: "PtrHeadUint64PtrMultiFieldsString",
   404  			data: &struct {
   405  				A *uint64 `json:"a,string"`
   406  				B *uint64 `json:"b,string"`
   407  			}{A: uint64ptr(1), B: uint64ptr(2)},
   408  		},
   409  
   410  		// PtrHeadUint64PtrNilMultiFields
   411  		{
   412  			name: "PtrHeadUint64PtrNilMultiFields",
   413  			data: &struct {
   414  				A *uint64 `json:"a"`
   415  				B *uint64 `json:"b"`
   416  			}{A: nil, B: nil},
   417  		},
   418  		{
   419  			name: "PtrHeadUint64PtrNilMultiFieldsOmitEmpty",
   420  			data: &struct {
   421  				A *uint64 `json:"a,omitempty"`
   422  				B *uint64 `json:"b,omitempty"`
   423  			}{A: nil, B: nil},
   424  		},
   425  		{
   426  			name: "PtrHeadUint64PtrNilMultiFieldsString",
   427  			data: &struct {
   428  				A *uint64 `json:"a,string"`
   429  				B *uint64 `json:"b,string"`
   430  			}{A: nil, B: nil},
   431  		},
   432  
   433  		// PtrHeadUint64NilMultiFields
   434  		{
   435  			name: "PtrHeadUint64NilMultiFields",
   436  			data: (*struct {
   437  				A *uint64 `json:"a"`
   438  				B *uint64 `json:"b"`
   439  			})(nil),
   440  		},
   441  		{
   442  			name: "PtrHeadUint64NilMultiFieldsOmitEmpty",
   443  			data: (*struct {
   444  				A *uint64 `json:"a,omitempty"`
   445  				B *uint64 `json:"b,omitempty"`
   446  			})(nil),
   447  		},
   448  		{
   449  			name: "PtrHeadUint64NilMultiFieldsString",
   450  			data: (*struct {
   451  				A *uint64 `json:"a,string"`
   452  				B *uint64 `json:"b,string"`
   453  			})(nil),
   454  		},
   455  
   456  		// HeadUint64ZeroNotRoot
   457  		{
   458  			name: "HeadUint64ZeroNotRoot",
   459  			data: struct {
   460  				A struct {
   461  					A uint64 `json:"a"`
   462  				}
   463  			}{},
   464  		},
   465  		{
   466  			name: "HeadUint64ZeroNotRootOmitEmpty",
   467  			data: struct {
   468  				A struct {
   469  					A uint64 `json:"a,omitempty"`
   470  				}
   471  			}{},
   472  		},
   473  		{
   474  			name: "HeadUint64ZeroNotRootString",
   475  			data: struct {
   476  				A struct {
   477  					A uint64 `json:"a,string"`
   478  				}
   479  			}{},
   480  		},
   481  
   482  		// HeadUint64NotRoot
   483  		{
   484  			name: "HeadUint64NotRoot",
   485  			data: struct {
   486  				A struct {
   487  					A uint64 `json:"a"`
   488  				}
   489  			}{A: struct {
   490  				A uint64 `json:"a"`
   491  			}{A: 1}},
   492  		},
   493  		{
   494  			name: "HeadUint64NotRootOmitEmpty",
   495  			data: struct {
   496  				A struct {
   497  					A uint64 `json:"a,omitempty"`
   498  				}
   499  			}{A: struct {
   500  				A uint64 `json:"a,omitempty"`
   501  			}{A: 1}},
   502  		},
   503  		{
   504  			name: "HeadUint64NotRootString",
   505  			data: struct {
   506  				A struct {
   507  					A uint64 `json:"a,string"`
   508  				}
   509  			}{A: struct {
   510  				A uint64 `json:"a,string"`
   511  			}{A: 1}},
   512  		},
   513  
   514  		// HeadUint64PtrNotRoot
   515  		{
   516  			name: "HeadUint64PtrNotRoot",
   517  			data: struct {
   518  				A struct {
   519  					A *uint64 `json:"a"`
   520  				}
   521  			}{A: struct {
   522  				A *uint64 `json:"a"`
   523  			}{uint64ptr(1)}},
   524  		},
   525  		{
   526  			name: "HeadUint64PtrNotRootOmitEmpty",
   527  			data: struct {
   528  				A struct {
   529  					A *uint64 `json:"a,omitempty"`
   530  				}
   531  			}{A: struct {
   532  				A *uint64 `json:"a,omitempty"`
   533  			}{uint64ptr(1)}},
   534  		},
   535  		{
   536  			name: "HeadUint64PtrNotRootString",
   537  			data: struct {
   538  				A struct {
   539  					A *uint64 `json:"a,string"`
   540  				}
   541  			}{A: struct {
   542  				A *uint64 `json:"a,string"`
   543  			}{uint64ptr(1)}},
   544  		},
   545  
   546  		// HeadUint64PtrNilNotRoot
   547  		{
   548  			name: "HeadUint64PtrNilNotRoot",
   549  			data: struct {
   550  				A struct {
   551  					A *uint64 `json:"a"`
   552  				}
   553  			}{},
   554  		},
   555  		{
   556  			name: "HeadUint64PtrNilNotRootOmitEmpty",
   557  			data: struct {
   558  				A struct {
   559  					A *uint64 `json:"a,omitempty"`
   560  				}
   561  			}{},
   562  		},
   563  		{
   564  			name: "HeadUint64PtrNilNotRootString",
   565  			data: struct {
   566  				A struct {
   567  					A *uint64 `json:"a,string"`
   568  				}
   569  			}{},
   570  		},
   571  
   572  		// PtrHeadUint64ZeroNotRoot
   573  		{
   574  			name: "PtrHeadUint64ZeroNotRoot",
   575  			data: struct {
   576  				A *struct {
   577  					A uint64 `json:"a"`
   578  				}
   579  			}{A: new(struct {
   580  				A uint64 `json:"a"`
   581  			})},
   582  		},
   583  		{
   584  			name: "PtrHeadUint64ZeroNotRootOmitEmpty",
   585  			data: struct {
   586  				A *struct {
   587  					A uint64 `json:"a,omitempty"`
   588  				}
   589  			}{A: new(struct {
   590  				A uint64 `json:"a,omitempty"`
   591  			})},
   592  		},
   593  		{
   594  			name: "PtrHeadUint64ZeroNotRootString",
   595  			data: struct {
   596  				A *struct {
   597  					A uint64 `json:"a,string"`
   598  				}
   599  			}{A: new(struct {
   600  				A uint64 `json:"a,string"`
   601  			})},
   602  		},
   603  
   604  		// PtrHeadUint64NotRoot
   605  		{
   606  			name: "PtrHeadUint64NotRoot",
   607  			data: struct {
   608  				A *struct {
   609  					A uint64 `json:"a"`
   610  				}
   611  			}{A: &(struct {
   612  				A uint64 `json:"a"`
   613  			}{A: 1})},
   614  		},
   615  		{
   616  			name: "PtrHeadUint64NotRootOmitEmpty",
   617  			data: struct {
   618  				A *struct {
   619  					A uint64 `json:"a,omitempty"`
   620  				}
   621  			}{A: &(struct {
   622  				A uint64 `json:"a,omitempty"`
   623  			}{A: 1})},
   624  		},
   625  		{
   626  			name: "PtrHeadUint64NotRootString",
   627  			data: struct {
   628  				A *struct {
   629  					A uint64 `json:"a,string"`
   630  				}
   631  			}{A: &(struct {
   632  				A uint64 `json:"a,string"`
   633  			}{A: 1})},
   634  		},
   635  
   636  		// PtrHeadUint64PtrNotRoot
   637  		{
   638  			name: "PtrHeadUint64PtrNotRoot",
   639  			data: struct {
   640  				A *struct {
   641  					A *uint64 `json:"a"`
   642  				}
   643  			}{A: &(struct {
   644  				A *uint64 `json:"a"`
   645  			}{A: uint64ptr(1)})},
   646  		},
   647  		{
   648  			name: "PtrHeadUint64PtrNotRootOmitEmpty",
   649  			data: struct {
   650  				A *struct {
   651  					A *uint64 `json:"a,omitempty"`
   652  				}
   653  			}{A: &(struct {
   654  				A *uint64 `json:"a,omitempty"`
   655  			}{A: uint64ptr(1)})},
   656  		},
   657  		{
   658  			name: "PtrHeadUint64PtrNotRootString",
   659  			data: struct {
   660  				A *struct {
   661  					A *uint64 `json:"a,string"`
   662  				}
   663  			}{A: &(struct {
   664  				A *uint64 `json:"a,string"`
   665  			}{A: uint64ptr(1)})},
   666  		},
   667  
   668  		// PtrHeadUint64PtrNilNotRoot
   669  		{
   670  			name: "PtrHeadUint64PtrNilNotRoot",
   671  			data: struct {
   672  				A *struct {
   673  					A *uint64 `json:"a"`
   674  				}
   675  			}{A: &(struct {
   676  				A *uint64 `json:"a"`
   677  			}{A: nil})},
   678  		},
   679  		{
   680  			name: "PtrHeadUint64PtrNilNotRootOmitEmpty",
   681  			data: struct {
   682  				A *struct {
   683  					A *uint64 `json:"a,omitempty"`
   684  				}
   685  			}{A: &(struct {
   686  				A *uint64 `json:"a,omitempty"`
   687  			}{A: nil})},
   688  		},
   689  		{
   690  			name: "PtrHeadUint64PtrNilNotRootString",
   691  			data: struct {
   692  				A *struct {
   693  					A *uint64 `json:"a,string"`
   694  				}
   695  			}{A: &(struct {
   696  				A *uint64 `json:"a,string"`
   697  			}{A: nil})},
   698  		},
   699  
   700  		// PtrHeadUint64NilNotRoot
   701  		{
   702  			name: "PtrHeadUint64NilNotRoot",
   703  			data: struct {
   704  				A *struct {
   705  					A *uint64 `json:"a"`
   706  				}
   707  			}{A: nil},
   708  		},
   709  		{
   710  			name: "PtrHeadUint64NilNotRootOmitEmpty",
   711  			data: struct {
   712  				A *struct {
   713  					A *uint64 `json:"a,omitempty"`
   714  				} `json:",omitempty"`
   715  			}{A: nil},
   716  		},
   717  		{
   718  			name: "PtrHeadUint64NilNotRootString",
   719  			data: struct {
   720  				A *struct {
   721  					A *uint64 `json:"a,string"`
   722  				} `json:",string"`
   723  			}{A: nil},
   724  		},
   725  
   726  		// HeadUint64ZeroMultiFieldsNotRoot
   727  		{
   728  			name: "HeadUint64ZeroMultiFieldsNotRoot",
   729  			data: struct {
   730  				A struct {
   731  					A uint64 `json:"a"`
   732  				}
   733  				B struct {
   734  					B uint64 `json:"b"`
   735  				}
   736  			}{},
   737  		},
   738  		{
   739  			name: "HeadUint64ZeroMultiFieldsNotRootOmitEmpty",
   740  			data: struct {
   741  				A struct {
   742  					A uint64 `json:"a,omitempty"`
   743  				}
   744  				B struct {
   745  					B uint64 `json:"b,omitempty"`
   746  				}
   747  			}{},
   748  		},
   749  		{
   750  			name: "HeadUint64ZeroMultiFieldsNotRootString",
   751  			data: struct {
   752  				A struct {
   753  					A uint64 `json:"a,string"`
   754  				}
   755  				B struct {
   756  					B uint64 `json:"b,string"`
   757  				}
   758  			}{},
   759  		},
   760  
   761  		// HeadUint64MultiFieldsNotRoot
   762  		{
   763  			name: "HeadUint64MultiFieldsNotRoot",
   764  			data: struct {
   765  				A struct {
   766  					A uint64 `json:"a"`
   767  				}
   768  				B struct {
   769  					B uint64 `json:"b"`
   770  				}
   771  			}{A: struct {
   772  				A uint64 `json:"a"`
   773  			}{A: 1}, B: struct {
   774  				B uint64 `json:"b"`
   775  			}{B: 2}},
   776  		},
   777  		{
   778  			name: "HeadUint64MultiFieldsNotRootOmitEmpty",
   779  			data: struct {
   780  				A struct {
   781  					A uint64 `json:"a,omitempty"`
   782  				}
   783  				B struct {
   784  					B uint64 `json:"b,omitempty"`
   785  				}
   786  			}{A: struct {
   787  				A uint64 `json:"a,omitempty"`
   788  			}{A: 1}, B: struct {
   789  				B uint64 `json:"b,omitempty"`
   790  			}{B: 2}},
   791  		},
   792  		{
   793  			name: "HeadUint64MultiFieldsNotRootString",
   794  			data: struct {
   795  				A struct {
   796  					A uint64 `json:"a,string"`
   797  				}
   798  				B struct {
   799  					B uint64 `json:"b,string"`
   800  				}
   801  			}{A: struct {
   802  				A uint64 `json:"a,string"`
   803  			}{A: 1}, B: struct {
   804  				B uint64 `json:"b,string"`
   805  			}{B: 2}},
   806  		},
   807  
   808  		// HeadUint64PtrMultiFieldsNotRoot
   809  		{
   810  			name: "HeadUint64PtrMultiFieldsNotRoot",
   811  			data: struct {
   812  				A struct {
   813  					A *uint64 `json:"a"`
   814  				}
   815  				B struct {
   816  					B *uint64 `json:"b"`
   817  				}
   818  			}{A: struct {
   819  				A *uint64 `json:"a"`
   820  			}{A: uint64ptr(1)}, B: struct {
   821  				B *uint64 `json:"b"`
   822  			}{B: uint64ptr(2)}},
   823  		},
   824  		{
   825  			name: "HeadUint64PtrMultiFieldsNotRootOmitEmpty",
   826  			data: struct {
   827  				A struct {
   828  					A *uint64 `json:"a,omitempty"`
   829  				}
   830  				B struct {
   831  					B *uint64 `json:"b,omitempty"`
   832  				}
   833  			}{A: struct {
   834  				A *uint64 `json:"a,omitempty"`
   835  			}{A: uint64ptr(1)}, B: struct {
   836  				B *uint64 `json:"b,omitempty"`
   837  			}{B: uint64ptr(2)}},
   838  		},
   839  		{
   840  			name: "HeadUint64PtrMultiFieldsNotRootString",
   841  			data: struct {
   842  				A struct {
   843  					A *uint64 `json:"a,string"`
   844  				}
   845  				B struct {
   846  					B *uint64 `json:"b,string"`
   847  				}
   848  			}{A: struct {
   849  				A *uint64 `json:"a,string"`
   850  			}{A: uint64ptr(1)}, B: struct {
   851  				B *uint64 `json:"b,string"`
   852  			}{B: uint64ptr(2)}},
   853  		},
   854  
   855  		// HeadUint64PtrNilMultiFieldsNotRoot
   856  		{
   857  			name: "HeadUint64PtrNilMultiFieldsNotRoot",
   858  			data: struct {
   859  				A struct {
   860  					A *uint64 `json:"a"`
   861  				}
   862  				B struct {
   863  					B *uint64 `json:"b"`
   864  				}
   865  			}{A: struct {
   866  				A *uint64 `json:"a"`
   867  			}{A: nil}, B: struct {
   868  				B *uint64 `json:"b"`
   869  			}{B: nil}},
   870  		},
   871  		{
   872  			name: "HeadUint64PtrNilMultiFieldsNotRootOmitEmpty",
   873  			data: struct {
   874  				A struct {
   875  					A *uint64 `json:"a,omitempty"`
   876  				}
   877  				B struct {
   878  					B *uint64 `json:"b,omitempty"`
   879  				}
   880  			}{A: struct {
   881  				A *uint64 `json:"a,omitempty"`
   882  			}{A: nil}, B: struct {
   883  				B *uint64 `json:"b,omitempty"`
   884  			}{B: nil}},
   885  		},
   886  		{
   887  			name: "HeadUint64PtrNilMultiFieldsNotRootString",
   888  			data: struct {
   889  				A struct {
   890  					A *uint64 `json:"a,string"`
   891  				}
   892  				B struct {
   893  					B *uint64 `json:"b,string"`
   894  				}
   895  			}{A: struct {
   896  				A *uint64 `json:"a,string"`
   897  			}{A: nil}, B: struct {
   898  				B *uint64 `json:"b,string"`
   899  			}{B: nil}},
   900  		},
   901  
   902  		// PtrHeadUint64ZeroMultiFieldsNotRoot
   903  		{
   904  			name: "PtrHeadUint64ZeroMultiFieldsNotRoot",
   905  			data: &struct {
   906  				A struct {
   907  					A uint64 `json:"a"`
   908  				}
   909  				B struct {
   910  					B uint64 `json:"b"`
   911  				}
   912  			}{},
   913  		},
   914  		{
   915  			name: "PtrHeadUint64ZeroMultiFieldsNotRootOmitEmpty",
   916  			data: &struct {
   917  				A struct {
   918  					A uint64 `json:"a,omitempty"`
   919  				}
   920  				B struct {
   921  					B uint64 `json:"b,omitempty"`
   922  				}
   923  			}{},
   924  		},
   925  		{
   926  			name: "PtrHeadUint64ZeroMultiFieldsNotRootString",
   927  			data: &struct {
   928  				A struct {
   929  					A uint64 `json:"a,string"`
   930  				}
   931  				B struct {
   932  					B uint64 `json:"b,string"`
   933  				}
   934  			}{},
   935  		},
   936  
   937  		// PtrHeadUint64MultiFieldsNotRoot
   938  		{
   939  			name: "PtrHeadUint64MultiFieldsNotRoot",
   940  			data: &struct {
   941  				A struct {
   942  					A uint64 `json:"a"`
   943  				}
   944  				B struct {
   945  					B uint64 `json:"b"`
   946  				}
   947  			}{A: struct {
   948  				A uint64 `json:"a"`
   949  			}{A: 1}, B: struct {
   950  				B uint64 `json:"b"`
   951  			}{B: 2}},
   952  		},
   953  		{
   954  			name: "PtrHeadUint64MultiFieldsNotRootOmitEmpty",
   955  			data: &struct {
   956  				A struct {
   957  					A uint64 `json:"a,omitempty"`
   958  				}
   959  				B struct {
   960  					B uint64 `json:"b,omitempty"`
   961  				}
   962  			}{A: struct {
   963  				A uint64 `json:"a,omitempty"`
   964  			}{A: 1}, B: struct {
   965  				B uint64 `json:"b,omitempty"`
   966  			}{B: 2}},
   967  		},
   968  		{
   969  			name: "PtrHeadUint64MultiFieldsNotRootString",
   970  			data: &struct {
   971  				A struct {
   972  					A uint64 `json:"a,string"`
   973  				}
   974  				B struct {
   975  					B uint64 `json:"b,string"`
   976  				}
   977  			}{A: struct {
   978  				A uint64 `json:"a,string"`
   979  			}{A: 1}, B: struct {
   980  				B uint64 `json:"b,string"`
   981  			}{B: 2}},
   982  		},
   983  
   984  		// PtrHeadUint64PtrMultiFieldsNotRoot
   985  		{
   986  			name: "PtrHeadUint64PtrMultiFieldsNotRoot",
   987  			data: &struct {
   988  				A *struct {
   989  					A *uint64 `json:"a"`
   990  				}
   991  				B *struct {
   992  					B *uint64 `json:"b"`
   993  				}
   994  			}{A: &(struct {
   995  				A *uint64 `json:"a"`
   996  			}{A: uint64ptr(1)}), B: &(struct {
   997  				B *uint64 `json:"b"`
   998  			}{B: uint64ptr(2)})},
   999  		},
  1000  		{
  1001  			name: "PtrHeadUint64PtrMultiFieldsNotRootOmitEmpty",
  1002  			data: &struct {
  1003  				A *struct {
  1004  					A *uint64 `json:"a,omitempty"`
  1005  				}
  1006  				B *struct {
  1007  					B *uint64 `json:"b,omitempty"`
  1008  				}
  1009  			}{A: &(struct {
  1010  				A *uint64 `json:"a,omitempty"`
  1011  			}{A: uint64ptr(1)}), B: &(struct {
  1012  				B *uint64 `json:"b,omitempty"`
  1013  			}{B: uint64ptr(2)})},
  1014  		},
  1015  		{
  1016  			name: "PtrHeadUint64PtrMultiFieldsNotRootString",
  1017  			data: &struct {
  1018  				A *struct {
  1019  					A *uint64 `json:"a,string"`
  1020  				}
  1021  				B *struct {
  1022  					B *uint64 `json:"b,string"`
  1023  				}
  1024  			}{A: &(struct {
  1025  				A *uint64 `json:"a,string"`
  1026  			}{A: uint64ptr(1)}), B: &(struct {
  1027  				B *uint64 `json:"b,string"`
  1028  			}{B: uint64ptr(2)})},
  1029  		},
  1030  
  1031  		// PtrHeadUint64PtrNilMultiFieldsNotRoot
  1032  		{
  1033  			name: "PtrHeadUint64PtrNilMultiFieldsNotRoot",
  1034  			data: &struct {
  1035  				A *struct {
  1036  					A *uint64 `json:"a"`
  1037  				}
  1038  				B *struct {
  1039  					B *uint64 `json:"b"`
  1040  				}
  1041  			}{A: nil, B: nil},
  1042  		},
  1043  		{
  1044  			name: "PtrHeadUint64PtrNilMultiFieldsNotRootOmitEmpty",
  1045  			data: &struct {
  1046  				A *struct {
  1047  					A *uint64 `json:"a,omitempty"`
  1048  				} `json:",omitempty"`
  1049  				B *struct {
  1050  					B *uint64 `json:"b,omitempty"`
  1051  				} `json:",omitempty"`
  1052  			}{A: nil, B: nil},
  1053  		},
  1054  		{
  1055  			name: "PtrHeadUint64PtrNilMultiFieldsNotRootString",
  1056  			data: &struct {
  1057  				A *struct {
  1058  					A *uint64 `json:"a,string"`
  1059  				} `json:",string"`
  1060  				B *struct {
  1061  					B *uint64 `json:"b,string"`
  1062  				} `json:",string"`
  1063  			}{A: nil, B: nil},
  1064  		},
  1065  
  1066  		// PtrHeadUint64NilMultiFieldsNotRoot
  1067  		{
  1068  			name: "PtrHeadUint64NilMultiFieldsNotRoot",
  1069  			data: (*struct {
  1070  				A *struct {
  1071  					A *uint64 `json:"a"`
  1072  				}
  1073  				B *struct {
  1074  					B *uint64 `json:"b"`
  1075  				}
  1076  			})(nil),
  1077  		},
  1078  		{
  1079  			name: "PtrHeadUint64NilMultiFieldsNotRootOmitEmpty",
  1080  			data: (*struct {
  1081  				A *struct {
  1082  					A *uint64 `json:"a,omitempty"`
  1083  				}
  1084  				B *struct {
  1085  					B *uint64 `json:"b,omitempty"`
  1086  				}
  1087  			})(nil),
  1088  		},
  1089  		{
  1090  			name: "PtrHeadUint64NilMultiFieldsNotRootString",
  1091  			data: (*struct {
  1092  				A *struct {
  1093  					A *uint64 `json:"a,string"`
  1094  				}
  1095  				B *struct {
  1096  					B *uint64 `json:"b,string"`
  1097  				}
  1098  			})(nil),
  1099  		},
  1100  
  1101  		// PtrHeadUint64DoubleMultiFieldsNotRoot
  1102  		{
  1103  			name: "PtrHeadUint64DoubleMultiFieldsNotRoot",
  1104  			data: &struct {
  1105  				A *struct {
  1106  					A uint64 `json:"a"`
  1107  					B uint64 `json:"b"`
  1108  				}
  1109  				B *struct {
  1110  					A uint64 `json:"a"`
  1111  					B uint64 `json:"b"`
  1112  				}
  1113  			}{A: &(struct {
  1114  				A uint64 `json:"a"`
  1115  				B uint64 `json:"b"`
  1116  			}{A: 1, B: 2}), B: &(struct {
  1117  				A uint64 `json:"a"`
  1118  				B uint64 `json:"b"`
  1119  			}{A: 3, B: 4})},
  1120  		},
  1121  		{
  1122  			name: "PtrHeadUint64DoubleMultiFieldsNotRootOmitEmpty",
  1123  			data: &struct {
  1124  				A *struct {
  1125  					A uint64 `json:"a,omitempty"`
  1126  					B uint64 `json:"b,omitempty"`
  1127  				}
  1128  				B *struct {
  1129  					A uint64 `json:"a,omitempty"`
  1130  					B uint64 `json:"b,omitempty"`
  1131  				}
  1132  			}{A: &(struct {
  1133  				A uint64 `json:"a,omitempty"`
  1134  				B uint64 `json:"b,omitempty"`
  1135  			}{A: 1, B: 2}), B: &(struct {
  1136  				A uint64 `json:"a,omitempty"`
  1137  				B uint64 `json:"b,omitempty"`
  1138  			}{A: 3, B: 4})},
  1139  		},
  1140  		{
  1141  			name: "PtrHeadUint64DoubleMultiFieldsNotRootString",
  1142  			data: &struct {
  1143  				A *struct {
  1144  					A uint64 `json:"a,string"`
  1145  					B uint64 `json:"b,string"`
  1146  				}
  1147  				B *struct {
  1148  					A uint64 `json:"a,string"`
  1149  					B uint64 `json:"b,string"`
  1150  				}
  1151  			}{A: &(struct {
  1152  				A uint64 `json:"a,string"`
  1153  				B uint64 `json:"b,string"`
  1154  			}{A: 1, B: 2}), B: &(struct {
  1155  				A uint64 `json:"a,string"`
  1156  				B uint64 `json:"b,string"`
  1157  			}{A: 3, B: 4})},
  1158  		},
  1159  
  1160  		// PtrHeadUint64NilDoubleMultiFieldsNotRoot
  1161  		{
  1162  			name: "PtrHeadUint64NilDoubleMultiFieldsNotRoot",
  1163  			data: &struct {
  1164  				A *struct {
  1165  					A uint64 `json:"a"`
  1166  					B uint64 `json:"b"`
  1167  				}
  1168  				B *struct {
  1169  					A uint64 `json:"a"`
  1170  					B uint64 `json:"b"`
  1171  				}
  1172  			}{A: nil, B: nil},
  1173  		},
  1174  		{
  1175  			name: "PtrHeadUint64NilDoubleMultiFieldsNotRootOmitEmpty",
  1176  			data: &struct {
  1177  				A *struct {
  1178  					A uint64 `json:"a,omitempty"`
  1179  					B uint64 `json:"b,omitempty"`
  1180  				} `json:",omitempty"`
  1181  				B *struct {
  1182  					A uint64 `json:"a,omitempty"`
  1183  					B uint64 `json:"b,omitempty"`
  1184  				} `json:",omitempty"`
  1185  			}{A: nil, B: nil},
  1186  		},
  1187  		{
  1188  			name: "PtrHeadUint64NilDoubleMultiFieldsNotRootString",
  1189  			data: &struct {
  1190  				A *struct {
  1191  					A uint64 `json:"a,string"`
  1192  					B uint64 `json:"b,string"`
  1193  				}
  1194  				B *struct {
  1195  					A uint64 `json:"a,string"`
  1196  					B uint64 `json:"b,string"`
  1197  				}
  1198  			}{A: nil, B: nil},
  1199  		},
  1200  
  1201  		// PtrHeadUint64NilDoubleMultiFieldsNotRoot
  1202  		{
  1203  			name: "PtrHeadUint64NilDoubleMultiFieldsNotRoot",
  1204  			data: (*struct {
  1205  				A *struct {
  1206  					A uint64 `json:"a"`
  1207  					B uint64 `json:"b"`
  1208  				}
  1209  				B *struct {
  1210  					A uint64 `json:"a"`
  1211  					B uint64 `json:"b"`
  1212  				}
  1213  			})(nil),
  1214  		},
  1215  		{
  1216  			name: "PtrHeadUint64NilDoubleMultiFieldsNotRootOmitEmpty",
  1217  			data: (*struct {
  1218  				A *struct {
  1219  					A uint64 `json:"a,omitempty"`
  1220  					B uint64 `json:"b,omitempty"`
  1221  				}
  1222  				B *struct {
  1223  					A uint64 `json:"a,omitempty"`
  1224  					B uint64 `json:"b,omitempty"`
  1225  				}
  1226  			})(nil),
  1227  		},
  1228  		{
  1229  			name: "PtrHeadUint64NilDoubleMultiFieldsNotRootString",
  1230  			data: (*struct {
  1231  				A *struct {
  1232  					A uint64 `json:"a,string"`
  1233  					B uint64 `json:"b,string"`
  1234  				}
  1235  				B *struct {
  1236  					A uint64 `json:"a,string"`
  1237  					B uint64 `json:"b,string"`
  1238  				}
  1239  			})(nil),
  1240  		},
  1241  
  1242  		// PtrHeadUint64PtrDoubleMultiFieldsNotRoot
  1243  		{
  1244  			name: "PtrHeadUint64PtrDoubleMultiFieldsNotRoot",
  1245  			data: &struct {
  1246  				A *struct {
  1247  					A *uint64 `json:"a"`
  1248  					B *uint64 `json:"b"`
  1249  				}
  1250  				B *struct {
  1251  					A *uint64 `json:"a"`
  1252  					B *uint64 `json:"b"`
  1253  				}
  1254  			}{A: &(struct {
  1255  				A *uint64 `json:"a"`
  1256  				B *uint64 `json:"b"`
  1257  			}{A: uint64ptr(1), B: uint64ptr(2)}), B: &(struct {
  1258  				A *uint64 `json:"a"`
  1259  				B *uint64 `json:"b"`
  1260  			}{A: uint64ptr(3), B: uint64ptr(4)})},
  1261  		},
  1262  		{
  1263  			name: "PtrHeadUint64PtrDoubleMultiFieldsNotRootOmitEmpty",
  1264  			data: &struct {
  1265  				A *struct {
  1266  					A *uint64 `json:"a,omitempty"`
  1267  					B *uint64 `json:"b,omitempty"`
  1268  				}
  1269  				B *struct {
  1270  					A *uint64 `json:"a,omitempty"`
  1271  					B *uint64 `json:"b,omitempty"`
  1272  				}
  1273  			}{A: &(struct {
  1274  				A *uint64 `json:"a,omitempty"`
  1275  				B *uint64 `json:"b,omitempty"`
  1276  			}{A: uint64ptr(1), B: uint64ptr(2)}), B: &(struct {
  1277  				A *uint64 `json:"a,omitempty"`
  1278  				B *uint64 `json:"b,omitempty"`
  1279  			}{A: uint64ptr(3), B: uint64ptr(4)})},
  1280  		},
  1281  		{
  1282  			name: "PtrHeadUint64PtrDoubleMultiFieldsNotRootString",
  1283  			data: &struct {
  1284  				A *struct {
  1285  					A *uint64 `json:"a,string"`
  1286  					B *uint64 `json:"b,string"`
  1287  				}
  1288  				B *struct {
  1289  					A *uint64 `json:"a,string"`
  1290  					B *uint64 `json:"b,string"`
  1291  				}
  1292  			}{A: &(struct {
  1293  				A *uint64 `json:"a,string"`
  1294  				B *uint64 `json:"b,string"`
  1295  			}{A: uint64ptr(1), B: uint64ptr(2)}), B: &(struct {
  1296  				A *uint64 `json:"a,string"`
  1297  				B *uint64 `json:"b,string"`
  1298  			}{A: uint64ptr(3), B: uint64ptr(4)})},
  1299  		},
  1300  
  1301  		// PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot
  1302  		{
  1303  			name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot",
  1304  			data: &struct {
  1305  				A *struct {
  1306  					A *uint64 `json:"a"`
  1307  					B *uint64 `json:"b"`
  1308  				}
  1309  				B *struct {
  1310  					A *uint64 `json:"a"`
  1311  					B *uint64 `json:"b"`
  1312  				}
  1313  			}{A: nil, B: nil},
  1314  		},
  1315  		{
  1316  			name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootOmitEmpty",
  1317  			data: &struct {
  1318  				A *struct {
  1319  					A *uint64 `json:"a,omitempty"`
  1320  					B *uint64 `json:"b,omitempty"`
  1321  				} `json:",omitempty"`
  1322  				B *struct {
  1323  					A *uint64 `json:"a,omitempty"`
  1324  					B *uint64 `json:"b,omitempty"`
  1325  				} `json:",omitempty"`
  1326  			}{A: nil, B: nil},
  1327  		},
  1328  		{
  1329  			name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootString",
  1330  			data: &struct {
  1331  				A *struct {
  1332  					A *uint64 `json:"a,string"`
  1333  					B *uint64 `json:"b,string"`
  1334  				}
  1335  				B *struct {
  1336  					A *uint64 `json:"a,string"`
  1337  					B *uint64 `json:"b,string"`
  1338  				}
  1339  			}{A: nil, B: nil},
  1340  		},
  1341  
  1342  		// PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot
  1343  		{
  1344  			name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot",
  1345  			data: (*struct {
  1346  				A *struct {
  1347  					A *uint64 `json:"a"`
  1348  					B *uint64 `json:"b"`
  1349  				}
  1350  				B *struct {
  1351  					A *uint64 `json:"a"`
  1352  					B *uint64 `json:"b"`
  1353  				}
  1354  			})(nil),
  1355  		},
  1356  		{
  1357  			name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootOmitEmpty",
  1358  			data: (*struct {
  1359  				A *struct {
  1360  					A *uint64 `json:"a,omitempty"`
  1361  					B *uint64 `json:"b,omitempty"`
  1362  				}
  1363  				B *struct {
  1364  					A *uint64 `json:"a,omitempty"`
  1365  					B *uint64 `json:"b,omitempty"`
  1366  				}
  1367  			})(nil),
  1368  		},
  1369  		{
  1370  			name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootString",
  1371  			data: (*struct {
  1372  				A *struct {
  1373  					A *uint64 `json:"a,string"`
  1374  					B *uint64 `json:"b,string"`
  1375  				}
  1376  				B *struct {
  1377  					A *uint64 `json:"a,string"`
  1378  					B *uint64 `json:"b,string"`
  1379  				}
  1380  			})(nil),
  1381  		},
  1382  
  1383  		// AnonymousHeadUint64
  1384  		{
  1385  			name: "AnonymousHeadUint64",
  1386  			data: struct {
  1387  				structUint64
  1388  				B uint64 `json:"b"`
  1389  			}{
  1390  				structUint64: structUint64{A: 1},
  1391  				B:            2,
  1392  			},
  1393  		},
  1394  		{
  1395  			name: "AnonymousHeadUint64OmitEmpty",
  1396  			data: struct {
  1397  				structUint64OmitEmpty
  1398  				B uint64 `json:"b,omitempty"`
  1399  			}{
  1400  				structUint64OmitEmpty: structUint64OmitEmpty{A: 1},
  1401  				B:                     2,
  1402  			},
  1403  		},
  1404  		{
  1405  			name: "AnonymousHeadUint64String",
  1406  			data: struct {
  1407  				structUint64String
  1408  				B uint64 `json:"b,string"`
  1409  			}{
  1410  				structUint64String: structUint64String{A: 1},
  1411  				B:                  2,
  1412  			},
  1413  		},
  1414  
  1415  		// PtrAnonymousHeadUint64
  1416  		{
  1417  			name: "PtrAnonymousHeadUint64",
  1418  			data: struct {
  1419  				*structUint64
  1420  				B uint64 `json:"b"`
  1421  			}{
  1422  				structUint64: &structUint64{A: 1},
  1423  				B:            2,
  1424  			},
  1425  		},
  1426  		{
  1427  			name: "PtrAnonymousHeadUint64OmitEmpty",
  1428  			data: struct {
  1429  				*structUint64OmitEmpty
  1430  				B uint64 `json:"b,omitempty"`
  1431  			}{
  1432  				structUint64OmitEmpty: &structUint64OmitEmpty{A: 1},
  1433  				B:                     2,
  1434  			},
  1435  		},
  1436  		{
  1437  			name: "PtrAnonymousHeadUint64String",
  1438  			data: struct {
  1439  				*structUint64String
  1440  				B uint64 `json:"b,string"`
  1441  			}{
  1442  				structUint64String: &structUint64String{A: 1},
  1443  				B:                  2,
  1444  			},
  1445  		},
  1446  
  1447  		// NilPtrAnonymousHeadUint64
  1448  		{
  1449  			name: "NilPtrAnonymousHeadUint64",
  1450  			data: struct {
  1451  				*structUint64
  1452  				B uint64 `json:"b"`
  1453  			}{
  1454  				structUint64: nil,
  1455  				B:            2,
  1456  			},
  1457  		},
  1458  		{
  1459  			name: "NilPtrAnonymousHeadUint64OmitEmpty",
  1460  			data: struct {
  1461  				*structUint64OmitEmpty
  1462  				B uint64 `json:"b,omitempty"`
  1463  			}{
  1464  				structUint64OmitEmpty: nil,
  1465  				B:                     2,
  1466  			},
  1467  		},
  1468  		{
  1469  			name: "NilPtrAnonymousHeadUint64String",
  1470  			data: struct {
  1471  				*structUint64String
  1472  				B uint64 `json:"b,string"`
  1473  			}{
  1474  				structUint64String: nil,
  1475  				B:                  2,
  1476  			},
  1477  		},
  1478  
  1479  		// AnonymousHeadUint64Ptr
  1480  		{
  1481  			name: "AnonymousHeadUint64Ptr",
  1482  			data: struct {
  1483  				structUint64Ptr
  1484  				B *uint64 `json:"b"`
  1485  			}{
  1486  				structUint64Ptr: structUint64Ptr{A: uint64ptr(1)},
  1487  				B:               uint64ptr(2),
  1488  			},
  1489  		},
  1490  		{
  1491  			name: "AnonymousHeadUint64PtrOmitEmpty",
  1492  			data: struct {
  1493  				structUint64PtrOmitEmpty
  1494  				B *uint64 `json:"b,omitempty"`
  1495  			}{
  1496  				structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: uint64ptr(1)},
  1497  				B:                        uint64ptr(2),
  1498  			},
  1499  		},
  1500  		{
  1501  			name: "AnonymousHeadUint64PtrString",
  1502  			data: struct {
  1503  				structUint64PtrString
  1504  				B *uint64 `json:"b,string"`
  1505  			}{
  1506  				structUint64PtrString: structUint64PtrString{A: uint64ptr(1)},
  1507  				B:                     uint64ptr(2),
  1508  			},
  1509  		},
  1510  
  1511  		// AnonymousHeadUint64PtrNil
  1512  		{
  1513  			name: "AnonymousHeadUint64PtrNil",
  1514  			data: struct {
  1515  				structUint64Ptr
  1516  				B *uint64 `json:"b"`
  1517  			}{
  1518  				structUint64Ptr: structUint64Ptr{A: nil},
  1519  				B:               uint64ptr(2),
  1520  			},
  1521  		},
  1522  		{
  1523  			name: "AnonymousHeadUint64PtrNilOmitEmpty",
  1524  			data: struct {
  1525  				structUint64PtrOmitEmpty
  1526  				B *uint64 `json:"b,omitempty"`
  1527  			}{
  1528  				structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: nil},
  1529  				B:                        uint64ptr(2),
  1530  			},
  1531  		},
  1532  		{
  1533  			name: "AnonymousHeadUint64PtrNilString",
  1534  			data: struct {
  1535  				structUint64PtrString
  1536  				B *uint64 `json:"b,string"`
  1537  			}{
  1538  				structUint64PtrString: structUint64PtrString{A: nil},
  1539  				B:                     uint64ptr(2),
  1540  			},
  1541  		},
  1542  
  1543  		// PtrAnonymousHeadUint64Ptr
  1544  		{
  1545  			name: "PtrAnonymousHeadUint64Ptr",
  1546  			data: struct {
  1547  				*structUint64Ptr
  1548  				B *uint64 `json:"b"`
  1549  			}{
  1550  				structUint64Ptr: &structUint64Ptr{A: uint64ptr(1)},
  1551  				B:               uint64ptr(2),
  1552  			},
  1553  		},
  1554  		{
  1555  			name: "PtrAnonymousHeadUint64PtrOmitEmpty",
  1556  			data: struct {
  1557  				*structUint64PtrOmitEmpty
  1558  				B *uint64 `json:"b,omitempty"`
  1559  			}{
  1560  				structUint64PtrOmitEmpty: &structUint64PtrOmitEmpty{A: uint64ptr(1)},
  1561  				B:                        uint64ptr(2),
  1562  			},
  1563  		},
  1564  		{
  1565  			name: "PtrAnonymousHeadUint64PtrString",
  1566  			data: struct {
  1567  				*structUint64PtrString
  1568  				B *uint64 `json:"b,string"`
  1569  			}{
  1570  				structUint64PtrString: &structUint64PtrString{A: uint64ptr(1)},
  1571  				B:                     uint64ptr(2),
  1572  			},
  1573  		},
  1574  
  1575  		// NilPtrAnonymousHeadUint64Ptr
  1576  		{
  1577  			name: "NilPtrAnonymousHeadUint64Ptr",
  1578  			data: struct {
  1579  				*structUint64Ptr
  1580  				B *uint64 `json:"b"`
  1581  			}{
  1582  				structUint64Ptr: nil,
  1583  				B:               uint64ptr(2),
  1584  			},
  1585  		},
  1586  		{
  1587  			name: "NilPtrAnonymousHeadUint64PtrOmitEmpty",
  1588  			data: struct {
  1589  				*structUint64PtrOmitEmpty
  1590  				B *uint64 `json:"b,omitempty"`
  1591  			}{
  1592  				structUint64PtrOmitEmpty: nil,
  1593  				B:                        uint64ptr(2),
  1594  			},
  1595  		},
  1596  		{
  1597  			name: "NilPtrAnonymousHeadUint64PtrString",
  1598  			data: struct {
  1599  				*structUint64PtrString
  1600  				B *uint64 `json:"b,string"`
  1601  			}{
  1602  				structUint64PtrString: nil,
  1603  				B:                     uint64ptr(2),
  1604  			},
  1605  		},
  1606  
  1607  		// AnonymousHeadUint64Only
  1608  		{
  1609  			name: "AnonymousHeadUint64Only",
  1610  			data: struct {
  1611  				structUint64
  1612  			}{
  1613  				structUint64: structUint64{A: 1},
  1614  			},
  1615  		},
  1616  		{
  1617  			name: "AnonymousHeadUint64OnlyOmitEmpty",
  1618  			data: struct {
  1619  				structUint64OmitEmpty
  1620  			}{
  1621  				structUint64OmitEmpty: structUint64OmitEmpty{A: 1},
  1622  			},
  1623  		},
  1624  		{
  1625  			name: "AnonymousHeadUint64OnlyString",
  1626  			data: struct {
  1627  				structUint64String
  1628  			}{
  1629  				structUint64String: structUint64String{A: 1},
  1630  			},
  1631  		},
  1632  
  1633  		// PtrAnonymousHeadUint64Only
  1634  		{
  1635  			name: "PtrAnonymousHeadUint64Only",
  1636  			data: struct {
  1637  				*structUint64
  1638  			}{
  1639  				structUint64: &structUint64{A: 1},
  1640  			},
  1641  		},
  1642  		{
  1643  			name: "PtrAnonymousHeadUint64OnlyOmitEmpty",
  1644  			data: struct {
  1645  				*structUint64OmitEmpty
  1646  			}{
  1647  				structUint64OmitEmpty: &structUint64OmitEmpty{A: 1},
  1648  			},
  1649  		},
  1650  		{
  1651  			name: "PtrAnonymousHeadUint64OnlyString",
  1652  			data: struct {
  1653  				*structUint64String
  1654  			}{
  1655  				structUint64String: &structUint64String{A: 1},
  1656  			},
  1657  		},
  1658  
  1659  		// NilPtrAnonymousHeadUint64Only
  1660  		{
  1661  			name: "NilPtrAnonymousHeadUint64Only",
  1662  			data: struct {
  1663  				*structUint64
  1664  			}{
  1665  				structUint64: nil,
  1666  			},
  1667  		},
  1668  		{
  1669  			name: "NilPtrAnonymousHeadUint64OnlyOmitEmpty",
  1670  			data: struct {
  1671  				*structUint64OmitEmpty
  1672  			}{
  1673  				structUint64OmitEmpty: nil,
  1674  			},
  1675  		},
  1676  		{
  1677  			name: "NilPtrAnonymousHeadUint64OnlyString",
  1678  			data: struct {
  1679  				*structUint64String
  1680  			}{
  1681  				structUint64String: nil,
  1682  			},
  1683  		},
  1684  
  1685  		// AnonymousHeadUint64PtrOnly
  1686  		{
  1687  			name: "AnonymousHeadUint64PtrOnly",
  1688  			data: struct {
  1689  				structUint64Ptr
  1690  			}{
  1691  				structUint64Ptr: structUint64Ptr{A: uint64ptr(1)},
  1692  			},
  1693  		},
  1694  		{
  1695  			name: "AnonymousHeadUint64PtrOnlyOmitEmpty",
  1696  			data: struct {
  1697  				structUint64PtrOmitEmpty
  1698  			}{
  1699  				structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: uint64ptr(1)},
  1700  			},
  1701  		},
  1702  		{
  1703  			name: "AnonymousHeadUint64PtrOnlyString",
  1704  			data: struct {
  1705  				structUint64PtrString
  1706  			}{
  1707  				structUint64PtrString: structUint64PtrString{A: uint64ptr(1)},
  1708  			},
  1709  		},
  1710  
  1711  		// AnonymousHeadUint64PtrNilOnly
  1712  		{
  1713  			name: "AnonymousHeadUint64PtrNilOnly",
  1714  			data: struct {
  1715  				structUint64Ptr
  1716  			}{
  1717  				structUint64Ptr: structUint64Ptr{A: nil},
  1718  			},
  1719  		},
  1720  		{
  1721  			name: "AnonymousHeadUint64PtrNilOnlyOmitEmpty",
  1722  			data: struct {
  1723  				structUint64PtrOmitEmpty
  1724  			}{
  1725  				structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: nil},
  1726  			},
  1727  		},
  1728  		{
  1729  			name: "AnonymousHeadUint64PtrNilOnlyString",
  1730  			data: struct {
  1731  				structUint64PtrString
  1732  			}{
  1733  				structUint64PtrString: structUint64PtrString{A: nil},
  1734  			},
  1735  		},
  1736  
  1737  		// PtrAnonymousHeadUint64PtrOnly
  1738  		{
  1739  			name: "PtrAnonymousHeadUint64PtrOnly",
  1740  			data: struct {
  1741  				*structUint64Ptr
  1742  			}{
  1743  				structUint64Ptr: &structUint64Ptr{A: uint64ptr(1)},
  1744  			},
  1745  		},
  1746  		{
  1747  			name: "PtrAnonymousHeadUint64PtrOnlyOmitEmpty",
  1748  			data: struct {
  1749  				*structUint64PtrOmitEmpty
  1750  			}{
  1751  				structUint64PtrOmitEmpty: &structUint64PtrOmitEmpty{A: uint64ptr(1)},
  1752  			},
  1753  		},
  1754  		{
  1755  			name: "PtrAnonymousHeadUint64PtrOnlyString",
  1756  			data: struct {
  1757  				*structUint64PtrString
  1758  			}{
  1759  				structUint64PtrString: &structUint64PtrString{A: uint64ptr(1)},
  1760  			},
  1761  		},
  1762  
  1763  		// NilPtrAnonymousHeadUint64PtrOnly
  1764  		{
  1765  			name: "NilPtrAnonymousHeadUint64PtrOnly",
  1766  			data: struct {
  1767  				*structUint64Ptr
  1768  			}{
  1769  				structUint64Ptr: nil,
  1770  			},
  1771  		},
  1772  		{
  1773  			name: "NilPtrAnonymousHeadUint64PtrOnlyOmitEmpty",
  1774  			data: struct {
  1775  				*structUint64PtrOmitEmpty
  1776  			}{
  1777  				structUint64PtrOmitEmpty: nil,
  1778  			},
  1779  		},
  1780  		{
  1781  			name: "NilPtrAnonymousHeadUint64PtrOnlyString",
  1782  			data: struct {
  1783  				*structUint64PtrString
  1784  			}{
  1785  				structUint64PtrString: nil,
  1786  			},
  1787  		},
  1788  	}
  1789  	for _, test := range tests {
  1790  		for _, indent := range []bool{true, false} {
  1791  			for _, htmlEscape := range []bool{true, false} {
  1792  				t.Run(fmt.Sprintf("%s_indent_%t_escape_%t", test.name, indent, htmlEscape), func(t *testing.T) {
  1793  					var buf bytes.Buffer
  1794  					enc := json.NewEncoder(&buf)
  1795  					enc.SetEscapeHTML(htmlEscape)
  1796  					if indent {
  1797  						enc.SetIndent("", "  ")
  1798  					}
  1799  					if err := enc.Encode(test.data); err != nil {
  1800  						t.Fatalf("%s(htmlEscape:%T): %+v: %s", test.name, htmlEscape, test.data, err)
  1801  					}
  1802  					stdresult := encodeByEncodingJSON(test.data, indent, htmlEscape)
  1803  					if buf.String() != stdresult {
  1804  						t.Errorf("%s(htmlEscape:%T): doesn't compatible with encoding/json. expected %q but got %q", test.name, htmlEscape, stdresult, buf.String())
  1805  					}
  1806  				})
  1807  			}
  1808  		}
  1809  	}
  1810  }