commit 1426f53d34581ed3a2c2fff82ee7413811fd20d3
parent ac278250a8d7a4543bba4f971d66eef067c9c07d
Author: francoispqt <francois@parquet.ninja>
Date: Sat, 19 May 2018 18:40:21 +0800
add tests for uint parsing
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/decode_number_uint_test.go b/decode_number_uint_test.go
@@ -56,6 +56,12 @@ func TestDecoderUint64(t *testing.T) {
err: true,
},
{
+ name: "basic-big-overflow",
+ json: "18446744073709551625",
+ expectedResult: 0,
+ err: true,
+ },
+ {
name: "basic-big-overflow2",
json: "184467440737095516161",
expectedResult: 0,
@@ -200,6 +206,12 @@ func TestDecoderUint32(t *testing.T) {
err: true,
},
{
+ name: "basic-big-overflow",
+ json: "4294967395",
+ expectedResult: 0,
+ err: true,
+ },
+ {
name: "basic-big-overflow2",
json: "42949672983",
expectedResult: 0,