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

int lazy any

This commit is contained in:
Tao Wen
2017-01-22 23:29:48 +08:00
parent 9df37bbd68
commit ba410b045b
7 changed files with 248 additions and 0 deletions

View File

@ -12,6 +12,13 @@ func Test_read_null(t *testing.T) {
should.True(iter.ReadNil())
iter = ParseString(`null`)
should.Nil(iter.Read())
iter = ParseString(`null`)
any, err := UnmarshalAnyFromString(`null`)
should.Nil(err)
should.Equal(0, any.ToInt())
should.Equal(float64(0), any.ToFloat64())
should.Equal("", any.ToString())
should.False(any.ToBool())
}
func Test_write_null(t *testing.T) {