mirror of https://github.com/goccy/go-json.git
Fix test case
This commit is contained in:
parent
7bcc2071e9
commit
43e676350c
|
@ -75,9 +75,11 @@ func Test_Decoder(t *testing.T) {
|
||||||
assertEq(t, "string", "hello", v)
|
assertEq(t, "string", "hello", v)
|
||||||
})
|
})
|
||||||
t.Run("float32", func(t *testing.T) {
|
t.Run("float32", func(t *testing.T) {
|
||||||
var v float32
|
var v struct {
|
||||||
assertErr(t, json.Unmarshal([]byte(`3.14`), &v))
|
F float32
|
||||||
assertEq(t, "float32", float32(3.14), v)
|
}
|
||||||
|
assertErr(t, json.Unmarshal([]byte(`{"f": 3.14}`), &v))
|
||||||
|
assertEq(t, "float32", float32(3.14), v.F)
|
||||||
})
|
})
|
||||||
t.Run("float64", func(t *testing.T) {
|
t.Run("float64", func(t *testing.T) {
|
||||||
var v float64
|
var v float64
|
||||||
|
|
Loading…
Reference in New Issue