Skip to content

Commit

Permalink
add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viewsharp committed Apr 25, 2024
1 parent fba4535 commit 90780da
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/cover/cover_slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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}},
Expand Down

0 comments on commit 90780da

Please sign in to comment.