1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-27 08:30:57 +02:00
json-iterator/jsoniter_any_float_test.go
2017-06-17 21:32:48 +08:00

16 lines
324 B
Go

package jsoniter
import (
"testing"
"github.com/json-iterator/go/require"
)
func Test_read_float_as_any(t *testing.T) {
should := require.New(t)
any, err := UnmarshalAnyFromString("12.3")
should.Nil(err)
should.Equal(float64(12.3), any.ToFloat64())
should.Equal("12.3", any.ToString())
should.True(any.ToBool())
}