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

read to interface{}

This commit is contained in:
Tao Wen
2017-01-21 16:09:38 +08:00
parent 928bc4ce72
commit 1d29fa38ef
8 changed files with 71 additions and 40 deletions

View File

@ -45,6 +45,12 @@ func Test_read_float(t *testing.T) {
}
}
func Test_read_float_via_read(t *testing.T) {
should := require.New(t)
iter := ParseString(`12.3`)
should.Equal(float64(12.3), iter.Read())
}
func Test_write_float32(t *testing.T) {
vals := []float32{0, 1, -1, 99, 0xff, 0xfff, 0xffff, 0xfffff, 0xffffff, 0x4ffffff, 0xfffffff,
-0x4ffffff, -0xfffffff, 1.2345, 1.23456, 1.234567, 1.001}