2021-01-16 16:16:26 +03:00
|
|
|
package json_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2021-11-25 14:22:04 +03:00
|
|
|
"fmt"
|
2021-01-16 16:16:26 +03:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/goccy/go-json"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCoverUint64(t *testing.T) {
|
|
|
|
type structUint64 struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUint64OmitEmpty struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUint64String struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
|
2021-01-16 16:16:26 +03:00
|
|
|
type structUint64Ptr struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUint64PtrOmitEmpty struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUint64PtrString struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
2021-01-16 16:16:26 +03:00
|
|
|
|
|
|
|
tests := []struct {
|
2021-02-15 05:28:09 +03:00
|
|
|
name string
|
|
|
|
data interface{}
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-03-19 17:31:29 +03:00
|
|
|
{
|
|
|
|
name: "Uint64",
|
|
|
|
data: uint64(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint64Ptr",
|
|
|
|
data: uint64ptr(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint64Ptr3",
|
|
|
|
data: uint64ptr3(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint64PtrNil",
|
|
|
|
data: (*uint64)(nil),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint64Ptr3Nil",
|
|
|
|
data: (***uint64)(nil),
|
|
|
|
},
|
|
|
|
|
2021-01-19 08:54:27 +03:00
|
|
|
// HeadUint64Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: uint64ptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: uint64ptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64Nil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64Nil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64ZeroMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C uint64 `json:"c"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C uint64 `json:"c,omitempty"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C uint64 `json:"c,string"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64MultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64MultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C uint64 `json:"c"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64MultiFieldsOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C uint64 `json:"c,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64MultiFieldsString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C uint64 `json:"c,string"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint64PtrMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C *uint64 `json:"c"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2), C: uint64ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C *uint64 `json:"c,omitempty"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2), C: uint64ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C *uint64 `json:"c,string"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2), C: uint64ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint64PtrNilMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C *uint64 `json:"c"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C *uint64 `json:"c,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
2021-02-15 05:28:09 +03:00
|
|
|
C *uint64 `json:"c,string"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-19 08:54:27 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64ZeroMultiFields
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64MultiFields
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64MultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64MultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64MultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrMultiFields
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNilMultiFields
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64NilMultiFields
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64NotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64NotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64NotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64NotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint64PtrNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{uint64ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{uint64ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{uint64ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint64PtrNilNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64NotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: uint64ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: uint64ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: uint64ptr(1)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNilNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64NilNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64ZeroMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64MultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64MultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64MultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64MultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64PtrMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: uint64ptr(1)}, B: struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{B: uint64ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: uint64ptr(1)}, B: struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{B: uint64ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: uint64ptr(1)}, B: struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{B: uint64ptr(2)}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint64PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "HeadUint64PtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64ZeroMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint64MultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64MultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64MultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint64 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64MultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint64PtrMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}{A: uint64ptr(1)}), B: &(struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{B: uint64ptr(2)})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}{A: uint64ptr(1)}), B: &(struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{B: uint64ptr(2)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}{A: uint64ptr(1)}), B: &(struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{B: uint64ptr(2)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64NilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64DoubleMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64DoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint64 `json:"a"`
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
A uint64 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64DoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64DoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: &(struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint64NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint64NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilDoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint64 `json:"a"`
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
})(nil),
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint64 `json:"a,omitempty"`
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64NilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint64 `json:"a,string"`
|
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint64PtrDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2)}), B: &(struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{A: uint64ptr(3), B: uint64ptr(4)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2)}), B: &(struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{A: uint64ptr(3), B: uint64ptr(4)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{A: uint64ptr(1), B: uint64ptr(2)}), B: &(struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{A: uint64ptr(3), B: uint64ptr(4)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a"`
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a,omitempty"`
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrHeadUint64PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint64 `json:"a,string"`
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint64
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint64: structUint64{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64OmitEmpty
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint64OmitEmpty: structUint64OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64String
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint64String: structUint64String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint64
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64
|
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint64: &structUint64{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64OmitEmpty
|
|
|
|
B uint64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint64OmitEmpty: &structUint64OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64String
|
|
|
|
B uint64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint64String: &structUint64String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint64
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint64
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint64 `json:"b"`
|
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint64: nil,
|
2021-01-16 16:16:26 +03:00
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64OmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint64OmitEmpty
|
|
|
|
B uint64 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint64OmitEmpty: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64String",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint64String
|
|
|
|
B uint64 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint64String: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUint64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64Ptr
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint64Ptr: structUint64Ptr{A: uint64ptr(1)},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrOmitEmpty
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: uint64ptr(1)},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrString
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint64PtrString: structUint64PtrString{A: uint64ptr(1)},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint64PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64Ptr
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint64Ptr: structUint64Ptr{A: nil},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrOmitEmpty
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: nil},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrString
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint64PtrString: structUint64PtrString{A: nil},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64Ptr
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint64Ptr: &structUint64Ptr{A: uint64ptr(1)},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrOmitEmpty
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: &structUint64PtrOmitEmpty{A: uint64ptr(1)},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrString
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint64PtrString: &structUint64PtrString{A: uint64ptr(1)},
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint64Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64Ptr
|
|
|
|
B *uint64 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint64Ptr: nil,
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrOmitEmpty
|
|
|
|
B *uint64 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: nil,
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrString
|
|
|
|
B *uint64 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint64PtrString: nil,
|
|
|
|
B: uint64ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint64Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64
|
|
|
|
}{
|
|
|
|
structUint64: structUint64{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64OnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64OmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64OmitEmpty: structUint64OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64OnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64String
|
|
|
|
}{
|
|
|
|
structUint64String: structUint64String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint64Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64
|
|
|
|
}{
|
|
|
|
structUint64: &structUint64{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64OnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64OmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64OmitEmpty: &structUint64OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64OnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64String
|
|
|
|
}{
|
|
|
|
structUint64String: &structUint64String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint64Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64
|
|
|
|
}{
|
|
|
|
structUint64: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64OnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64OmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64OmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64OnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64String
|
|
|
|
}{
|
|
|
|
structUint64String: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint64PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64Ptr
|
|
|
|
}{
|
|
|
|
structUint64Ptr: structUint64Ptr{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrString
|
|
|
|
}{
|
|
|
|
structUint64PtrString: structUint64PtrString{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint64PtrNilOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrNilOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64Ptr
|
|
|
|
}{
|
|
|
|
structUint64Ptr: structUint64Ptr{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrNilOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: structUint64PtrOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "AnonymousHeadUint64PtrNilOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint64PtrString
|
|
|
|
}{
|
|
|
|
structUint64PtrString: structUint64PtrString{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint64PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64Ptr
|
|
|
|
}{
|
|
|
|
structUint64Ptr: &structUint64Ptr{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64PtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: &structUint64PtrOmitEmpty{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "PtrAnonymousHeadUint64PtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrString
|
|
|
|
}{
|
|
|
|
structUint64PtrString: &structUint64PtrString{A: uint64ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint64PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64Ptr
|
|
|
|
}{
|
|
|
|
structUint64Ptr: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64PtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint64PtrOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:28:09 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint64PtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint64PtrString
|
|
|
|
}{
|
|
|
|
structUint64PtrString: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
for _, test := range tests {
|
|
|
|
for _, indent := range []bool{true, false} {
|
|
|
|
for _, htmlEscape := range []bool{true, false} {
|
2021-11-25 14:22:04 +03:00
|
|
|
t.Run(fmt.Sprintf("%s_indent_%t_escape_%t", test.name, indent, htmlEscape), func(t *testing.T) {
|
|
|
|
var buf bytes.Buffer
|
|
|
|
enc := json.NewEncoder(&buf)
|
|
|
|
enc.SetEscapeHTML(htmlEscape)
|
|
|
|
if indent {
|
|
|
|
enc.SetIndent("", " ")
|
|
|
|
}
|
|
|
|
if err := enc.Encode(test.data); err != nil {
|
|
|
|
t.Fatalf("%s(htmlEscape:%T): %+v: %s", test.name, htmlEscape, test.data, err)
|
|
|
|
}
|
|
|
|
stdresult := encodeByEncodingJSON(test.data, indent, htmlEscape)
|
|
|
|
if buf.String() != stdresult {
|
|
|
|
t.Errorf("%s(htmlEscape:%T): doesn't compatible with encoding/json. expected %q but got %q", test.name, htmlEscape, stdresult, buf.String())
|
|
|
|
}
|
|
|
|
})
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|