1
0
mirror of https://github.com/golang/go synced 2024-09-30 19:38:33 -06:00

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 <bradfitz@golang.org>
This commit is contained in:
Martin Möhrmann 2014-12-27 11:53:09 +01:00 committed by Brad Fitzpatrick
parent 09d369f8dd
commit 0668b595b6

View File

@ -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"},