Skip to content

Commit

Permalink
more test
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed May 19, 2024
1 parent 30f8df8 commit 14c40e6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion conv/j2p/conv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,16 @@ func TestUnknownFields(t *testing.T) {
desc := getExampleDesc()
data := getExampleData()
root := ast.NewRaw(string(data))
root.SetAny("UNKNOWN", 1)
root.Set("UNKNOWN-null", ast.NewNull())
root.SetAny("UNKNOWN-num", 1)
root.SetAny("UNKNOWN-bool", true)
root.SetAny("UNKNOWN-string", "a")
root.Set("UNKNOWN-object", ast.NewRaw(`{"1":1}`))
root.Set("UNKNOWN-array", ast.NewRaw(`[1]`))
base := root.Get("InnerBase2")
base.SetAny("UNKNOWN-sub", 1)
data, _ = root.MarshalJSON()
println(string(data))
cv := NewBinaryConv(conv.Options{
DisallowUnknownField: false,
})
Expand Down

0 comments on commit 14c40e6

Please sign in to comment.