1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

rewrite how eface and iface are handled

This commit is contained in:
Tao Wen
2018-02-21 12:16:50 +08:00
parent ea6403326b
commit 2fcbb23d96
13 changed files with 301 additions and 243 deletions

View File

@ -35,4 +35,14 @@ func Test_customize_tag_key(t *testing.T) {
str, err := json.MarshalToString(TestObject{"hello"})
should.Nil(err)
should.Equal(`{"field":"hello"}`, str)
}
func Test_read_large_number_as_interface(t *testing.T) {
should := require.New(t)
var val interface{}
err := jsoniter.Config{UseNumber: true}.Froze().UnmarshalFromString(`123456789123456789123456789`, &val)
should.Nil(err)
output, err := jsoniter.MarshalToString(val)
should.Nil(err)
should.Equal(`123456789123456789123456789`, output)
}