2021-01-16 16:16:26 +03:00
|
|
|
package json_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/goccy/go-json"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCoverUint(t *testing.T) {
|
|
|
|
type structUint struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUintOmitEmpty struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUintString struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
|
2021-01-16 16:16:26 +03:00
|
|
|
type structUintPtr struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
type structUintPtrOmitEmpty struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
type structUintPtrString struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
2021-01-16 16:16:26 +03:00
|
|
|
|
|
|
|
tests := []struct {
|
2021-02-15 05:24:35 +03:00
|
|
|
name string
|
|
|
|
data interface{}
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
// HeadUintZero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUint
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUint",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintPtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintZero
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZero",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUint
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUint",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintZeroMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,omitempty"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,string"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFields",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `json:"c,omitempty"`
|
|
|
|
}{A: 1, B: 2, C: 3},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C uint `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
|
|
|
|
|
|
|
// HeadUintPtrMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,string"`
|
|
|
|
}{A: uptr(1), B: uptr(2), C: uptr(3)},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNilMultiFields
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,omitempty"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
2021-02-15 05:24:35 +03:00
|
|
|
C *uint `json:"c,string"`
|
|
|
|
}{A: nil, B: nil, C: nil},
|
2021-01-19 08:54:27 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintZeroMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{A: 1, B: 2},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: uptr(1), B: uptr(2)},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNilMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintNilMultiFields
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFields",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{uptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{uptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{uptr(1)}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// HeadUintPtrNilNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintZeroNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: new(struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNilNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintNilNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintZeroMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintPtrMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)}, B: struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{B: uptr(2)}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// HeadUintPtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "HeadUintPtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
A struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: nil}, B: struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{B: nil}},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintZeroMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintZeroMultiFieldsNotRootString",
|
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 uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}
|
|
|
|
B struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{B: 2}},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsNotRootOmitEmpty",
|
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 uint `json:"a,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintMultiFieldsNotRootString",
|
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 uint `json:"a,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
}{A: 1}, B: struct {
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{B: 2}},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{B: uptr(2)})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{B: uptr(2)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}{A: uptr(1)}), B: &(struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{B: uptr(2)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
} `json:",string"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintNilMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintDoubleMultiFieldsNotRoot
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint `json:"a"`
|
2021-01-19 08:54:27 +03:00
|
|
|
B uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
B *struct {
|
|
|
|
A uint `json:"a"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: &(struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-01-19 08:54:27 +03:00
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{A: 3, B: 4})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: &(struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{A: 1, B: 2}), B: &(struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{A: 3, B: 4})},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootOmitEmpty",
|
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 uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `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
|
|
|
|
|
|
|
// PtrHeadUintNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRoot",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
2021-01-16 16:16:26 +03:00
|
|
|
A *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a"`
|
|
|
|
B uint `json:"b"`
|
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
})(nil),
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
B *struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
A uint `json:"a,omitempty"`
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A uint `json:"a,string"`
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// PtrHeadUintPtrDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: uptr(1), B: uptr(2)}), B: &(struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{A: uptr(3), B: uptr(4)})},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
} `json:",omitempty"`
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: &struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
}{A: nil, B: nil},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrHeadUintPtrNilDoubleMultiFieldsNotRoot
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRoot",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a"`
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,omitempty"`
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrHeadUintPtrNilDoubleMultiFieldsNotRootString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: (*struct {
|
|
|
|
A *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
B *struct {
|
|
|
|
A *uint `json:"a,string"`
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}
|
|
|
|
})(nil),
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUint
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUint",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUint
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint: structUint{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintOmitEmpty
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: structUintOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintString
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintString: structUintString{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUint
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUint",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint
|
|
|
|
B uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUint: &structUint{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintOmitEmpty
|
|
|
|
B uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: &structUintOmitEmpty{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintString
|
|
|
|
B uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintString: &structUintString{A: 1},
|
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUint
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUint",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUint
|
2021-01-16 16:16:26 +03:00
|
|
|
B uint `json:"b"`
|
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUint: nil,
|
2021-01-16 16:16:26 +03:00
|
|
|
B: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOmitEmpty",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUintOmitEmpty
|
|
|
|
B uint `json:"b,omitempty"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUintOmitEmpty: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintString",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
2021-01-19 08:54:27 +03:00
|
|
|
*structUintString
|
|
|
|
B uint `json:"b,string"`
|
2021-01-16 16:16:26 +03:00
|
|
|
}{
|
2021-01-19 08:54:27 +03:00
|
|
|
structUintString: nil,
|
|
|
|
B: 2,
|
2021-01-16 16:16:26 +03:00
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
|
|
|
|
// AnonymousHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUintPtrNil
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNil",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: nil},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: &structUintPtr{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: &structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: &structUintPtrString{A: uptr(1)},
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUintPtr
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtr",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
B *uint `json:"b"`
|
|
|
|
}{
|
|
|
|
structUintPtr: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
B *uint `json:"b,omitempty"`
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
B *uint `json:"b,string"`
|
|
|
|
}{
|
|
|
|
structUintPtrString: nil,
|
|
|
|
B: uptr(2),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUintOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUint
|
|
|
|
}{
|
|
|
|
structUint: structUint{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: structUintOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintString
|
|
|
|
}{
|
|
|
|
structUintString: structUintString{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUintOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint
|
|
|
|
}{
|
|
|
|
structUint: &structUint{A: 1},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: &structUintOmitEmpty{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintString
|
|
|
|
}{
|
|
|
|
structUintString: &structUintString{A: 1},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUintOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUint
|
|
|
|
}{
|
|
|
|
structUint: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintString
|
|
|
|
}{
|
|
|
|
structUintString: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUintPtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// AnonymousHeadUintPtrNilOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: structUintPtr{A: nil},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: structUintPtrOmitEmpty{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "AnonymousHeadUintPtrNilOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: structUintPtrString{A: nil},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// PtrAnonymousHeadUintPtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: &structUintPtr{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: &structUintPtrOmitEmpty{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "PtrAnonymousHeadUintPtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: &structUintPtrString{A: uptr(1)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// NilPtrAnonymousHeadUintPtrOnly
|
2021-01-16 16:16:26 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnly",
|
2021-01-16 16:16:26 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtr
|
|
|
|
}{
|
|
|
|
structUintPtr: nil,
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 08:54:27 +03:00
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnlyOmitEmpty",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrOmitEmpty
|
|
|
|
}{
|
|
|
|
structUintPtrOmitEmpty: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-15 05:24:35 +03:00
|
|
|
name: "NilPtrAnonymousHeadUintPtrOnlyString",
|
2021-01-19 08:54:27 +03:00
|
|
|
data: struct {
|
|
|
|
*structUintPtrString
|
|
|
|
}{
|
|
|
|
structUintPtrString: 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} {
|
|
|
|
var buf bytes.Buffer
|
|
|
|
enc := json.NewEncoder(&buf)
|
|
|
|
enc.SetEscapeHTML(htmlEscape)
|
|
|
|
if indent {
|
|
|
|
enc.SetIndent("", " ")
|
|
|
|
}
|
|
|
|
if err := enc.Encode(test.data); err != nil {
|
2021-02-15 05:24:35 +03:00
|
|
|
t.Fatalf("%s(htmlEscape:%T): %+v: %s", test.name, htmlEscape, test.data, err)
|
2021-01-16 16:16:26 +03:00
|
|
|
}
|
2021-01-19 08:54:27 +03:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|