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

fix read int

This commit is contained in:
Tao Wen
2017-02-07 09:24:36 +08:00
parent 6880076b44
commit 2922666717
4 changed files with 26 additions and 2 deletions

View File

@ -64,6 +64,22 @@ func Test_read_int32(t *testing.T) {
}
}
func Test_read_int32_array(t *testing.T) {
should := require.New(t)
input := `[123,456,789]`
val := make([]int32, 0)
UnmarshalFromString(input, &val)
should.Equal(3, len(val))
}
func Test_read_int64_array(t *testing.T) {
should := require.New(t)
input := `[123,456,789]`
val := make([]int64, 0)
UnmarshalFromString(input, &val)
should.Equal(3, len(val))
}
func Test_read_int32_overflow(t *testing.T) {
should := require.New(t)
input := "123456789123456789,"