From: Martin Möhrmann Date: Sat, 27 Dec 2014 10:53:09 +0000 (+0100) Subject: strconv/itoa: add test to generate the longest output string possible by formatBits X-Git-Tag: go1.5beta1~2514 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0668b595b604a4bd3e5327bd14ffd71cfa7dbc68;p=gostls13.git strconv/itoa: add test to generate the longest output string possible by formatBits The new test case produces the longest string representation possible and thereby uses all of the 65 bytes in the buffer array used by the formatBits function. Change-Id: I11320c4de56ced5ff098b7e37f1be08e456573e2 Reviewed-on: https://go-review.googlesource.com/2108 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/strconv/itoa_test.go b/src/strconv/itoa_test.go index e0213ae9af..48dc03e839 100644 --- a/src/strconv/itoa_test.go +++ b/src/strconv/itoa_test.go @@ -51,6 +51,7 @@ var itob64tests = []itob64Test{ {-0x123456789abcdef, 16, "-123456789abcdef"}, {1<<63 - 1, 16, "7fffffffffffffff"}, {1<<63 - 1, 2, "111111111111111111111111111111111111111111111111111111111111111"}, + {-1 << 63, 2, "-1000000000000000000000000000000000000000000000000000000000000000"}, {16, 17, "g"}, {25, 25, "10"},