From 90780da0d9977a032f988501704197c6f8ab08df Mon Sep 17 00:00:00 2001 From: viewsharp Date: Thu, 25 Apr 2024 16:32:10 +0300 Subject: [PATCH] add additional tests --- test/cover/cover_slice_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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}},