From 43fb3bb7c9b27ef42fff249a01ef646fc5809fc1 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 1 Mar 2020 21:43:28 +0100 Subject: [PATCH] test uint builtin typecheck overflow values for []byte --- typecheck/builtin/uint_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/typecheck/builtin/uint_test.go b/typecheck/builtin/uint_test.go index c1d26aa..4a6ceb8 100644 --- a/typecheck/builtin/uint_test.go +++ b/typecheck/builtin/uint_test.go @@ -96,6 +96,11 @@ func TestUint_Values(t *testing.T) { // strane offset because of how precision works {fmt.Sprintf("%f", float64(math.MaxUint64+1024*3)), false}, + {[]byte(fmt.Sprintf("%d", math.MaxInt64)), true}, + {[]byte(fmt.Sprintf("%d", uint(math.MaxUint64))), true}, + // strane offset because of how precision works + {[]byte(fmt.Sprintf("%f", float64(math.MaxUint64+1024*3))), false}, + {"string", false}, {[]byte("bytes"), false}, {-0.1, false},