diff --git a/cover_int_test.go b/cover_int_test.go index d05b11a..71189cb 100644 --- a/cover_int_test.go +++ b/cover_int_test.go @@ -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 {