mirror of https://github.com/goccy/go-json.git
Add test case
This commit is contained in:
parent
e12b021c70
commit
4cade6589b
|
@ -17,6 +17,9 @@ func TestCoverInt(t *testing.T) {
|
|||
type structIntString struct {
|
||||
A int `json:"a,string"`
|
||||
}
|
||||
type structIntStringOmitEmpty struct {
|
||||
A int `json:"a,omitempty,string"`
|
||||
}
|
||||
|
||||
type structIntPtr struct {
|
||||
A *int `json:"a"`
|
||||
|
@ -27,6 +30,9 @@ func TestCoverInt(t *testing.T) {
|
|||
type structIntPtrString struct {
|
||||
A *int `json:"a,string"`
|
||||
}
|
||||
type structIntPtrStringOmitEmpty struct {
|
||||
A *int `json:"a,omitempty,string"`
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -152,6 +158,12 @@ func TestCoverInt(t *testing.T) {
|
|||
A int `json:"a,string"`
|
||||
}{},
|
||||
},
|
||||
{
|
||||
name: "PtrHeadIntZeroStringOmitEmpty",
|
||||
data: &struct {
|
||||
A int `json:"a,string,omitempty"`
|
||||
}{},
|
||||
},
|
||||
|
||||
// PtrHeadInt
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue