You've already forked json-iterator
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:
@ -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,"
|
||||
|
Reference in New Issue
Block a user