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 TestCoverUint32(t *testing.T) {
|
|
|
|
type structUint32 struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUint32OmitEmpty struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUint32String struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
|
2021-01-16 16:16:26 +03:00
|
|
|
type structUint32Ptr struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUint32PtrOmitEmpty struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUint32PtrString struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
2021-01-16 16:16:26 +03:00
|
|
|
|
|
|
|
tests := []struct {
|
2021-02-15 05:27:57 +03:00
|
|
|
name string
|
|
|
|
data interface{}
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-03-19 17:31:29 +03:00
|
|
|
{
|
|
|
|
name: "Uint32",
|
|
|
|
data: uint32(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint32Ptr",
|
|
|
|
data: uint32ptr(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint32Ptr3",
|
|
|
|
data: uint32ptr3(10),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint32PtrNil",
|
|
|
|
data: (*uint32)(nil),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Uint32Ptr3Nil",
|
|
|
|
data: (***uint32)(nil),
|
|
|
|
},
|
|
|
|
|
2021-01-19 08:54:27 +03:00
|
|
|
// HeadUint32Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: uint32ptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32Zero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32Zero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: uint32ptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32Nil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32Nil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32ZeroMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C uint32 `json:"c"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C uint32 `json:"c,omitempty"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C uint32 `json:"c,string"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32MultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32MultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C uint32 `json:"c"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32MultiFieldsOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C uint32 `json:"c,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32MultiFieldsString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C uint32 `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
|
|
|
|
|
|
|
// HeadUint32PtrMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C *uint32 `json:"c"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2), C: uint32ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C *uint32 `json:"c,omitempty"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2), C: uint32ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C *uint32 `json:"c,string"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2), C: uint32ptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint32PtrNilMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C *uint32 `json:"c"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C *uint32 `json:"c,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
2021-02-15 05:27:57 +03:00
|
|
|
C *uint32 `json:"c,string"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-19 08:54:27 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32ZeroMultiFields
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32MultiFields
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32MultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32MultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32MultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrMultiFields
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNilMultiFields
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32NilMultiFields
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32NotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32NotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32NotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32NotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint32PtrNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{uint32ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{uint32ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{uint32ptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUint32PtrNilNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32ZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32NotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: uint32ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: uint32ptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: uint32ptr(1)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNilNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32NilNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32ZeroMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32MultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32MultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32MultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32MultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32PtrMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: uint32ptr(1)}, B: struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{B: uint32ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: uint32ptr(1)}, B: struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{B: uint32ptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: uint32ptr(1)}, B: struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{B: uint32ptr(2)}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint32PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "HeadUint32PtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32ZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32ZeroMultiFieldsNotRootString",
|
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 uint32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint32MultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32MultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32MultiFieldsNotRootOmitEmpty",
|
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 uint32 `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint32 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32MultiFieldsNotRootString",
|
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 uint32 `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint32PtrMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}{A: uint32ptr(1)}), B: &(struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{B: uint32ptr(2)})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}{A: uint32ptr(1)}), B: &(struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{B: uint32ptr(2)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}{A: uint32ptr(1)}), B: &(struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{B: uint32ptr(2)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32NilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32DoubleMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32DoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint32 `json:"a"`
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
A uint32 `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32DoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32DoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: &(struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint32NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilDoubleMultiFieldsNotRootOmitEmpty",
|
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 uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `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
|
|
|
|
|
|
|
// PtrHeadUint32NilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilDoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint32 `json:"a"`
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
})(nil),
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint32 `json:"a,omitempty"`
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32NilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint32 `json:"a,string"`
|
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUint32PtrDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2)}), B: &(struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{A: uint32ptr(3), B: uint32ptr(4)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2)}), B: &(struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{A: uint32ptr(3), B: uint32ptr(4)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{A: uint32ptr(1), B: uint32ptr(2)}), B: &(struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{A: uint32ptr(3), B: uint32ptr(4)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint32PtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a"`
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a,omitempty"`
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrHeadUint32PtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint32 `json:"a,string"`
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint32
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint32: structUint32{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32OmitEmpty
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint32OmitEmpty: structUint32OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32String
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint32String: structUint32String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint32
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32
|
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint32: &structUint32{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32OmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32OmitEmpty
|
|
|
|
B uint32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint32OmitEmpty: &structUint32OmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32String",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32String
|
|
|
|
B uint32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint32String: &structUint32String{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint32
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint32
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint32 `json:"b"`
|
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint32: nil,
|
2021-01-16 16:16:26 +03:00
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32OmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint32OmitEmpty
|
|
|
|
B uint32 `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint32OmitEmpty: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32String",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint32String
|
|
|
|
B uint32 `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint32String: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUint32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32Ptr
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint32Ptr: structUint32Ptr{A: uint32ptr(1)},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrOmitEmpty
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: structUint32PtrOmitEmpty{A: uint32ptr(1)},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrString
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint32PtrString: structUint32PtrString{A: uint32ptr(1)},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint32PtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32Ptr
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint32Ptr: structUint32Ptr{A: nil},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrOmitEmpty
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: structUint32PtrOmitEmpty{A: nil},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrString
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint32PtrString: structUint32PtrString{A: nil},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32Ptr
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint32Ptr: &structUint32Ptr{A: uint32ptr(1)},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrOmitEmpty
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: &structUint32PtrOmitEmpty{A: uint32ptr(1)},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrString
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint32PtrString: &structUint32PtrString{A: uint32ptr(1)},
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint32Ptr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32Ptr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32Ptr
|
|
|
|
B *uint32 `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint32Ptr: nil,
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32PtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrOmitEmpty
|
|
|
|
B *uint32 `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: nil,
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32PtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrString
|
|
|
|
B *uint32 `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUint32PtrString: nil,
|
|
|
|
B: uint32ptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint32Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32
|
|
|
|
}{
|
|
|
|
structUint32: structUint32{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32OnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32OmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32OmitEmpty: structUint32OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32OnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32String
|
|
|
|
}{
|
|
|
|
structUint32String: structUint32String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint32Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32
|
|
|
|
}{
|
|
|
|
structUint32: &structUint32{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32OnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32OmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32OmitEmpty: &structUint32OmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32OnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32String
|
|
|
|
}{
|
|
|
|
structUint32String: &structUint32String{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint32Only
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32Only",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32
|
|
|
|
}{
|
|
|
|
structUint32: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32OnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32OmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32OmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32OnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32String
|
|
|
|
}{
|
|
|
|
structUint32String: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint32PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32Ptr
|
|
|
|
}{
|
|
|
|
structUint32Ptr: structUint32Ptr{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: structUint32PtrOmitEmpty{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrString
|
|
|
|
}{
|
|
|
|
structUint32PtrString: structUint32PtrString{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint32PtrNilOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrNilOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32Ptr
|
|
|
|
}{
|
|
|
|
structUint32Ptr: structUint32Ptr{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrNilOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: structUint32PtrOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "AnonymousHeadUint32PtrNilOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint32PtrString
|
|
|
|
}{
|
|
|
|
structUint32PtrString: structUint32PtrString{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint32PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32Ptr
|
|
|
|
}{
|
|
|
|
structUint32Ptr: &structUint32Ptr{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32PtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: &structUint32PtrOmitEmpty{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "PtrAnonymousHeadUint32PtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrString
|
|
|
|
}{
|
|
|
|
structUint32PtrString: &structUint32PtrString{A: uint32ptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint32PtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32PtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32Ptr
|
|
|
|
}{
|
|
|
|
structUint32Ptr: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32PtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUint32PtrOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:27:57 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint32PtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint32PtrString
|
|
|
|
}{
|
|
|
|
structUint32PtrString: 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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|