Skip to content

Commit

Permalink
chore: add unit test for goccy#459
Browse files Browse the repository at this point in the history
  • Loading branch information
NgoKimPhu committed Nov 3, 2023
1 parent dd524a4 commit 2cfcb0c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2710,3 +2710,19 @@ func TestIssue441(t *testing.T) {
assertErr(t, err)
assertEq(t, "unexpected result", "{}", string(b))
}

func TestIssue459(t *testing.T) {
type A struct {
Z *struct {
A
} `json:"z,omitempty"`
}

type B struct {
A
}

b, err := json.Marshal(B{})
assertErr(t, err)
assertEq(t, "unexpected result", "{}", string(b))
}

0 comments on commit 2cfcb0c

Please sign in to comment.