1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-30 08:36:43 +02:00
json-iterator/any_tests/jsoniter_any_null_test.go
2018-02-13 20:58:29 +08:00

17 lines
355 B
Go

package any_tests
import (
"github.com/stretchr/testify/require"
"testing"
"github.com/json-iterator/go"
)
func Test_read_null_as_any(t *testing.T) {
should := require.New(t)
any := jsoniter.Get([]byte(`null`))
should.Equal(0, any.ToInt())
should.Equal(float64(0), any.ToFloat64())
should.Equal("", any.ToString())
should.False(any.ToBool())
}