diff --git a/test/cover/cover_slice_test.go b/test/cover/cover_slice_test.go index 557bab7..70a0306 100644 --- a/test/cover/cover_slice_test.go +++ b/test/cover/cover_slice_test.go @@ -22,6 +22,12 @@ func (c coverSliceMarshalJSONMap) MarshalJSON() ([]byte, error) { return json.Marshal(map[string]any(c)) } +type coverSliceMarshalJSONMapPtr map[string]any + +func (c *coverSliceMarshalJSONMapPtr) MarshalJSON() ([]byte, error) { + return json.Marshal(map[string]any(*c)) +} + type coverSliceMarshalText struct { A int } @@ -162,6 +168,18 @@ func TestCoverSlice(t *testing.T) { name: "SliceMarshalJSONMap", data: []coverSliceMarshalJSONMap{{"foo": "bar"}, {"some": 1}}, }, + { + name: "SliceMarshalJSONMap", + data: []*coverSliceMarshalJSONMap{{"foo": "bar"}, {"some": 1}}, + }, + { + name: "SliceMarshalJSONMap", + data: []coverSliceMarshalJSONMapPtr{{"foo": "bar"}, {"some": 1}}, + }, + { + name: "SliceMarshalJSONMap", + data: []*coverSliceMarshalJSONMapPtr{{"foo": "bar"}, {"some": 1}}, + }, { name: "SliceMarshalText", data: []coverSliceMarshalText{{A: 1}, {A: 2}},