1
0
mirror of https://github.com/json-iterator/go.git synced 2025-05-13 21:36:29 +02:00

fix tests

This commit is contained in:
Tao Wen 2017-07-01 00:35:19 +08:00
parent fa0965a968
commit abcf9a8d76

View File

@ -212,10 +212,10 @@ func Test_unmarshaler_and_decoder(t *testing.T) {
obj := TestObject{} obj := TestObject{}
val := ObjectImplementedUnmarshaler(0) val := ObjectImplementedUnmarshaler(0)
obj.Field = &val obj.Field = &val
err := json.Unmarshal([]byte(`{"Field":"hello"}`), &obj) err := json.Unmarshal([]byte(`{"Field":"100"}`), &obj)
should.Nil(err) should.Nil(err)
should.Equal(100, int(*obj.Field)) should.Equal(100, int(*obj.Field))
err = Unmarshal([]byte(`{"Field":"hello"}`), &obj) err = Unmarshal([]byte(`{"Field":"100"}`), &obj)
should.Nil(err) should.Nil(err)
should.Equal(10, int(*obj.Field)) should.Equal(10, int(*obj.Field))
} }