1
0
mirror of https://github.com/json-iterator/go.git synced 2024-12-09 08:55:35 +02:00
json-iterator/jsoniter_any_null_test.go

16 lines
314 B
Go
Raw Normal View History

2017-06-17 15:32:48 +02:00
package jsoniter
import (
"github.com/json-iterator/go/require"
2017-06-19 17:43:53 +02:00
"testing"
2017-06-17 15:32:48 +02:00
)
func Test_read_null_as_any(t *testing.T) {
should := require.New(t)
any := Get([]byte(`null`))
2017-06-17 15:32:48 +02:00
should.Equal(0, any.ToInt())
should.Equal(float64(0), any.ToFloat64())
should.Equal("", any.ToString())
should.False(any.ToBool())
}