From fdd32cccf27ee9e05f809978d78d8fd33dd5c27f Mon Sep 17 00:00:00 2001 From: Nao Yonashiro Date: Sat, 12 Mar 2022 23:41:52 +0900 Subject: [PATCH] test: adds ints boundary cases --- decode_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/decode_test.go b/decode_test.go index a3cb746..209c658 100644 --- a/decode_test.go +++ b/decode_test.go @@ -1317,6 +1317,12 @@ var unmarshalTests = []unmarshalTest{ ptr: new(string), out: "hello\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdworld", }, + {in: "-128", ptr: new(int8), out: int8(-128)}, + {in: "127", ptr: new(int8), out: int8(127)}, + {in: "-32768", ptr: new(int16), out: int16(-32768)}, + {in: "32767", ptr: new(int16), out: int16(32767)}, + {in: "-2147483648", ptr: new(int32), out: int32(-2147483648)}, + {in: "2147483647", ptr: new(int32), out: int32(2147483647)}, } type All struct {