mirror of https://github.com/goccy/go-json.git
3547 lines
86 KiB
Go
3547 lines
86 KiB
Go
package json_test
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/goccy/go-json"
|
|
)
|
|
|
|
type coverMarshalText struct {
|
|
A int
|
|
}
|
|
|
|
func (c coverMarshalText) MarshalText() ([]byte, error) {
|
|
return []byte(`"hello"`), nil
|
|
}
|
|
|
|
type coverPtrMarshalText struct {
|
|
B int
|
|
}
|
|
|
|
func (c *coverPtrMarshalText) MarshalText() ([]byte, error) {
|
|
return []byte(`"hello"`), nil
|
|
}
|
|
|
|
func TestCoverMarshalText(t *testing.T) {
|
|
type structMarshalText struct {
|
|
A coverMarshalText `json:"a"`
|
|
}
|
|
type structMarshalTextOmitEmpty struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
type structMarshalTextString struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}
|
|
type structPtrMarshalText struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}
|
|
type structPtrMarshalTextOmitEmpty struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
type structPtrMarshalTextString struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
|
|
type structMarshalTextPtr struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}
|
|
type structMarshalTextPtrOmitEmpty struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
type structMarshalTextPtrString struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}
|
|
type structPtrMarshalTextPtr struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}
|
|
type structPtrMarshalTextPtrOmitEmpty struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
type structPtrMarshalTextPtrString struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
|
|
tests := []struct {
|
|
name string
|
|
data interface{}
|
|
}{
|
|
// HeadMarshalTextZero
|
|
{
|
|
name: "HeadMarshalTextZero",
|
|
data: struct {
|
|
A coverMarshalText `json:"a"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextZeroOmitEmpty",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextZeroString",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZero",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroOmitEmpty",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroString",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}{},
|
|
},
|
|
|
|
// HeadMarshalText
|
|
{
|
|
name: "HeadMarshalText",
|
|
data: struct {
|
|
A coverMarshalText `json:"a"`
|
|
}{A: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextOmitEmpty",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}{A: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextString",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}{A: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalText",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}{A: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextOmitEmpty",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextString",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}{A: coverPtrMarshalText{}},
|
|
},
|
|
|
|
// HeadMarshalTextPtr
|
|
{
|
|
name: "HeadMarshalTextPtr",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{A: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrOmitEmpty",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{A: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrString",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{A: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtr",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{A: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrOmitEmpty",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrString",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{A: &coverPtrMarshalText{}},
|
|
},
|
|
|
|
// HeadMarshalTextPtrNil
|
|
{
|
|
name: "HeadMarshalTextPtrNil",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNilOmitEmpty",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNilString",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNil",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilOmitEmpty",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilString",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{A: nil},
|
|
},
|
|
|
|
// PtrHeadMarshalTextZero
|
|
{
|
|
name: "PtrHeadMarshalTextZero",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextZeroOmitEmpty",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextZeroString",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZero",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroOmitEmpty",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroString",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}{},
|
|
},
|
|
|
|
// PtrHeadMarshalText
|
|
{
|
|
name: "PtrHeadMarshalText",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a"`
|
|
}{A: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextOmitEmpty",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}{A: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextString",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}{A: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalText",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}{A: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextOmitEmpty",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextString",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}{A: coverPtrMarshalText{}},
|
|
},
|
|
|
|
// PtrHeadMarshalTextPtr
|
|
{
|
|
name: "PtrHeadMarshalTextPtr",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{A: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrOmitEmpty",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{A: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrString",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{A: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtr",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{A: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrOmitEmpty",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrString",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{A: &coverPtrMarshalText{}},
|
|
},
|
|
|
|
// PtrHeadMarshalTextPtrNil
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNil",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilOmitEmpty",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilString",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNil",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilOmitEmpty",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilString",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{A: nil},
|
|
},
|
|
|
|
// PtrHeadMarshalTextNil
|
|
{
|
|
name: "PtrHeadMarshalTextNil",
|
|
data: (*struct {
|
|
A *coverMarshalText `json:"a"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilOmitEmpty",
|
|
data: (*struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilString",
|
|
data: (*struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNil",
|
|
data: (*struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilOmitEmpty",
|
|
data: (*struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilString",
|
|
data: (*struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
})(nil),
|
|
},
|
|
|
|
// HeadMarshalTextZeroMultiFields
|
|
{
|
|
name: "HeadMarshalTextZeroMultiFields",
|
|
data: struct {
|
|
A coverMarshalText `json:"a"`
|
|
B coverMarshalText `json:"b"`
|
|
C coverMarshalText `json:"c"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextZeroMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
B coverMarshalText `json:"b,omitempty"`
|
|
C coverMarshalText `json:"c,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextZeroMultiFields",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
B coverMarshalText `json:"b,string"`
|
|
C coverMarshalText `json:"c,string"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroMultiFields",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
B coverPtrMarshalText `json:"b"`
|
|
C coverPtrMarshalText `json:"c"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
B coverPtrMarshalText `json:"b,omitempty"`
|
|
C coverPtrMarshalText `json:"c,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroMultiFields",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
B coverPtrMarshalText `json:"b,string"`
|
|
C coverPtrMarshalText `json:"c,string"`
|
|
}{},
|
|
},
|
|
|
|
// HeadMarshalTextMultiFields
|
|
{
|
|
name: "HeadMarshalTextMultiFields",
|
|
data: struct {
|
|
A coverMarshalText `json:"a"`
|
|
B coverMarshalText `json:"b"`
|
|
C coverMarshalText `json:"c"`
|
|
}{A: coverMarshalText{}, B: coverMarshalText{}, C: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
B coverMarshalText `json:"b,omitempty"`
|
|
C coverMarshalText `json:"c,omitempty"`
|
|
}{A: coverMarshalText{}, B: coverMarshalText{}, C: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextMultiFieldsString",
|
|
data: struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
B coverMarshalText `json:"b,string"`
|
|
C coverMarshalText `json:"c,string"`
|
|
}{A: coverMarshalText{}, B: coverMarshalText{}, C: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextMultiFields",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
B coverPtrMarshalText `json:"b"`
|
|
C coverPtrMarshalText `json:"c"`
|
|
}{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}, C: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
B coverPtrMarshalText `json:"b,omitempty"`
|
|
C coverPtrMarshalText `json:"c,omitempty"`
|
|
}{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}, C: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextMultiFieldsString",
|
|
data: struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
B coverPtrMarshalText `json:"b,string"`
|
|
C coverPtrMarshalText `json:"c,string"`
|
|
}{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}, C: coverPtrMarshalText{}},
|
|
},
|
|
|
|
// HeadMarshalTextPtrMultiFields
|
|
{
|
|
name: "HeadMarshalTextPtrMultiFields",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a"`
|
|
B *coverMarshalText `json:"b"`
|
|
C *coverMarshalText `json:"c"`
|
|
}{A: &coverMarshalText{}, B: &coverMarshalText{}, C: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
B *coverMarshalText `json:"b,omitempty"`
|
|
C *coverMarshalText `json:"c,omitempty"`
|
|
}{A: &coverMarshalText{}, B: &coverMarshalText{}, C: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrMultiFieldsString",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
B *coverMarshalText `json:"b,string"`
|
|
C *coverMarshalText `json:"c,string"`
|
|
}{A: &coverMarshalText{}, B: &coverMarshalText{}, C: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrMultiFields",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
B *coverPtrMarshalText `json:"b"`
|
|
C *coverPtrMarshalText `json:"c"`
|
|
}{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}, C: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
B *coverPtrMarshalText `json:"b,omitempty"`
|
|
C *coverPtrMarshalText `json:"c,omitempty"`
|
|
}{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}, C: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrMultiFieldsString",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
B *coverPtrMarshalText `json:"b,string"`
|
|
C *coverPtrMarshalText `json:"c,string"`
|
|
}{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}, C: &coverPtrMarshalText{}},
|
|
},
|
|
|
|
// HeadMarshalTextPtrNilMultiFields
|
|
{
|
|
name: "HeadMarshalTextPtrNilMultiFields",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a"`
|
|
B *coverMarshalText `json:"b"`
|
|
C *coverMarshalText `json:"c"`
|
|
}{A: nil, B: nil, C: nil},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNilMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
B *coverMarshalText `json:"b,omitempty"`
|
|
C *coverMarshalText `json:"c,omitempty"`
|
|
}{A: nil, B: nil, C: nil},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNilMultiFieldsString",
|
|
data: struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
B *coverMarshalText `json:"b,string"`
|
|
C *coverMarshalText `json:"c,string"`
|
|
}{A: nil, B: nil, C: nil},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilMultiFields",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
B *coverPtrMarshalText `json:"b"`
|
|
C *coverPtrMarshalText `json:"c"`
|
|
}{A: nil, B: nil, C: nil},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilMultiFieldsOmitEmpty",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
B *coverPtrMarshalText `json:"b,omitempty"`
|
|
C *coverPtrMarshalText `json:"c,omitempty"`
|
|
}{A: nil, B: nil, C: nil},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilMultiFieldsString",
|
|
data: struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
B *coverPtrMarshalText `json:"b,string"`
|
|
C *coverPtrMarshalText `json:"c,string"`
|
|
}{A: nil, B: nil, C: nil},
|
|
},
|
|
|
|
// PtrHeadMarshalTextZeroMultiFields
|
|
{
|
|
name: "PtrHeadMarshalTextZeroMultiFields",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a"`
|
|
B coverMarshalText `json:"b"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextZeroMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
B coverMarshalText `json:"b,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextZeroMultiFieldsString",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
B coverMarshalText `json:"b,string"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroMultiFields",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
B coverPtrMarshalText `json:"b"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
B coverPtrMarshalText `json:"b,omitempty"`
|
|
}{},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroMultiFieldsString",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
B coverPtrMarshalText `json:"b,string"`
|
|
}{},
|
|
},
|
|
|
|
// PtrHeadMarshalTextMultiFields
|
|
{
|
|
name: "PtrHeadMarshalTextMultiFields",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a"`
|
|
B coverMarshalText `json:"b"`
|
|
}{A: coverMarshalText{}, B: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
B coverMarshalText `json:"b,omitempty"`
|
|
}{A: coverMarshalText{}, B: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextMultiFieldsString",
|
|
data: &struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
B coverMarshalText `json:"b,string"`
|
|
}{A: coverMarshalText{}, B: coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextMultiFields",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
B coverPtrMarshalText `json:"b"`
|
|
}{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
B coverPtrMarshalText `json:"b,omitempty"`
|
|
}{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextMultiFieldsString",
|
|
data: &struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
B coverPtrMarshalText `json:"b,string"`
|
|
}{A: coverPtrMarshalText{}, B: coverPtrMarshalText{}},
|
|
},
|
|
|
|
// PtrHeadMarshalTextPtrMultiFields
|
|
{
|
|
name: "PtrHeadMarshalTextPtrMultiFields",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a"`
|
|
B *coverMarshalText `json:"b"`
|
|
}{A: &coverMarshalText{}, B: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
B *coverMarshalText `json:"b,omitempty"`
|
|
}{A: &coverMarshalText{}, B: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrMultiFieldsString",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
B *coverMarshalText `json:"b,string"`
|
|
}{A: &coverMarshalText{}, B: &coverMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrMultiFields",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
B *coverPtrMarshalText `json:"b"`
|
|
}{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
B *coverPtrMarshalText `json:"b,omitempty"`
|
|
}{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrMultiFieldsString",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
B *coverPtrMarshalText `json:"b,string"`
|
|
}{A: &coverPtrMarshalText{}, B: &coverPtrMarshalText{}},
|
|
},
|
|
|
|
// PtrHeadMarshalTextPtrNilMultiFields
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilMultiFields",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a"`
|
|
B *coverMarshalText `json:"b"`
|
|
}{A: nil, B: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
B *coverMarshalText `json:"b,omitempty"`
|
|
}{A: nil, B: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilMultiFieldsString",
|
|
data: &struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
B *coverMarshalText `json:"b,string"`
|
|
}{A: nil, B: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilMultiFields",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
B *coverPtrMarshalText `json:"b"`
|
|
}{A: nil, B: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsOmitEmpty",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
B *coverPtrMarshalText `json:"b,omitempty"`
|
|
}{A: nil, B: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilMultiFieldsString",
|
|
data: &struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
B *coverPtrMarshalText `json:"b,string"`
|
|
}{A: nil, B: nil},
|
|
},
|
|
|
|
// PtrHeadMarshalTextNilMultiFields
|
|
{
|
|
name: "PtrHeadMarshalTextNilMultiFields",
|
|
data: (*struct {
|
|
A coverMarshalText `json:"a"`
|
|
B coverMarshalText `json:"b"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilMultiFieldsOmitEmpty",
|
|
data: (*struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
B coverMarshalText `json:"b,omitempty"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilMultiFieldsString",
|
|
data: (*struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
B coverMarshalText `json:"b,string"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilMultiFields",
|
|
data: (*struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
B coverPtrMarshalText `json:"b"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilMultiFieldsOmitEmpty",
|
|
data: (*struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
B coverPtrMarshalText `json:"b,omitempty"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilMultiFieldsString",
|
|
data: (*struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
B coverPtrMarshalText `json:"b,string"`
|
|
})(nil),
|
|
},
|
|
|
|
// PtrHeadMarshalTextNilMultiFields
|
|
{
|
|
name: "PtrHeadMarshalTextNilMultiFields",
|
|
data: (*struct {
|
|
A *coverMarshalText `json:"a"`
|
|
B *coverMarshalText `json:"b"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilMultiFieldsOmitEmpty",
|
|
data: (*struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
B *coverMarshalText `json:"b,omitempty"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilMultiFieldsString",
|
|
data: (*struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
B *coverMarshalText `json:"b,string"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilMultiFields",
|
|
data: (*struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
B *coverPtrMarshalText `json:"b"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilMultiFieldsOmitEmpty",
|
|
data: (*struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
B *coverPtrMarshalText `json:"b,omitempty"`
|
|
})(nil),
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilMultiFieldsString",
|
|
data: (*struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
B *coverPtrMarshalText `json:"b,string"`
|
|
})(nil),
|
|
},
|
|
|
|
// HeadMarshalTextZeroNotRoot
|
|
{
|
|
name: "HeadMarshalTextZeroNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A coverMarshalText `json:"a"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextZeroNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextZeroNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextZeroNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{},
|
|
},
|
|
|
|
// HeadMarshalTextNotRoot
|
|
{
|
|
name: "HeadMarshalTextNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A coverMarshalText `json:"a"`
|
|
}
|
|
}{A: struct {
|
|
A coverMarshalText `json:"a"`
|
|
}{A: coverMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}{A: coverMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}
|
|
}{A: struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}{A: coverMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}{A: coverPtrMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: coverPtrMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{A: struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}{A: coverPtrMarshalText{}}},
|
|
},
|
|
|
|
// HeadMarshalTextPtrNotRoot
|
|
{
|
|
name: "HeadMarshalTextPtrNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}
|
|
}{A: struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{&coverMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{&coverMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}
|
|
}{A: struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{&coverMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{&coverPtrMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{&coverPtrMarshalText{}}},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{A: struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{&coverPtrMarshalText{}}},
|
|
},
|
|
|
|
// HeadMarshalTextPtrNilNotRoot
|
|
{
|
|
name: "HeadMarshalTextPtrNilNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNilNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadMarshalTextPtrNilNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilNotRoot",
|
|
data: struct {
|
|
A struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilNotRootOmitEmpty",
|
|
data: struct {
|
|
A struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{},
|
|
},
|
|
{
|
|
name: "HeadPtrMarshalTextPtrNilNotRootString",
|
|
data: struct {
|
|
A struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{},
|
|
},
|
|
|
|
// PtrHeadMarshalTextZeroNotRoot
|
|
{
|
|
name: "PtrHeadMarshalTextZeroNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A coverMarshalText `json:"a"`
|
|
}
|
|
}{A: new(struct {
|
|
A coverMarshalText `json:"a"`
|
|
})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextZeroNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: new(struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextZeroNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}
|
|
}{A: new(struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: new(struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: new(struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextZeroNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{A: new(struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
})},
|
|
},
|
|
|
|
// PtrHeadMarshalTextNotRoot
|
|
{
|
|
name: "PtrHeadMarshalTextNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A coverMarshalText `json:"a"`
|
|
}
|
|
}{A: &(struct {
|
|
A coverMarshalText `json:"a"`
|
|
}{A: coverMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: &(struct {
|
|
A coverMarshalText `json:"a,omitempty"`
|
|
}{A: coverMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}
|
|
}{A: &(struct {
|
|
A coverMarshalText `json:"a,string"`
|
|
}{A: coverMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: &(struct {
|
|
A coverPtrMarshalText `json:"a"`
|
|
}{A: coverPtrMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: &(struct {
|
|
A coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: coverPtrMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{A: &(struct {
|
|
A coverPtrMarshalText `json:"a,string"`
|
|
}{A: coverPtrMarshalText{}})},
|
|
},
|
|
|
|
// PtrHeadMarshalTextPtrNotRoot
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{A: &coverMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{A: &coverMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{A: &coverMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{A: &coverPtrMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: &coverPtrMarshalText{}})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{A: &coverPtrMarshalText{}})},
|
|
},
|
|
|
|
// PtrHeadMarshalTextPtrNilNotRoot
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}{A: nil})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
}{A: nil})},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextPtrNilNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
}{A: nil})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}{A: nil})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverPtrMarshalText `json:"a,omitempty"`
|
|
}{A: nil})},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextPtrNilNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}
|
|
}{A: &(struct {
|
|
A *coverPtrMarshalText `json:"a,string"`
|
|
}{A: nil})},
|
|
},
|
|
|
|
// PtrHeadMarshalTextNilNotRoot
|
|
{
|
|
name: "PtrHeadMarshalTextNilNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a"`
|
|
}
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilNotRootOmitEmpty",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a,omitempty"`
|
|
} `json:",omitempty"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadMarshalTextNilNotRootString",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverMarshalText `json:"a,string"`
|
|
} `json:",string"`
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilNotRoot",
|
|
data: struct {
|
|
A *struct {
|
|
A *coverPtrMarshalText `json:"a"`
|
|
}
|
|
}{A: nil},
|
|
},
|
|
{
|
|
name: "PtrHeadPtrMarshalTextNilNotRootOmitEmpty",
|
|
data: struct {
|