]> Cypherpunks repositories - gostls13.git/commitdiff
strconv/itoa: add test to generate the longest output string possible by formatBits
authorMartin Möhrmann <martisch@uos.de>
Sat, 27 Dec 2014 10:53:09 +0000 (11:53 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 27 Dec 2014 22:35:08 +0000 (22:35 +0000)
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>
src/strconv/itoa_test.go

index e0213ae9afecd4d1540b2644f9a255abaa321cd7..48dc03e839081cc90c28f800098b21678701925f 100644 (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"},