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:
parent
fa0965a968
commit
abcf9a8d76
@ -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))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user