jsoniter_any_float_test.go 291 B

1234567891011121314
  1. package jsoniter
  2. import (
  3. "github.com/json-iterator/go/require"
  4. "testing"
  5. )
  6. func Test_read_float_as_any(t *testing.T) {
  7. should := require.New(t)
  8. any := Get([]byte("12.3"))
  9. should.Equal(float64(12.3), any.ToFloat64())
  10. should.Equal("12.3", any.ToString())
  11. should.True(any.ToBool())
  12. }