Commit 0668b595 authored by Martin Möhrmann's avatar Martin Möhrmann Committed by Brad Fitzpatrick

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/2108Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 09d369f8
...@@ -51,6 +51,7 @@ var itob64tests = []itob64Test{ ...@@ -51,6 +51,7 @@ var itob64tests = []itob64Test{
{-0x123456789abcdef, 16, "-123456789abcdef"}, {-0x123456789abcdef, 16, "-123456789abcdef"},
{1<<63 - 1, 16, "7fffffffffffffff"}, {1<<63 - 1, 16, "7fffffffffffffff"},
{1<<63 - 1, 2, "111111111111111111111111111111111111111111111111111111111111111"}, {1<<63 - 1, 2, "111111111111111111111111111111111111111111111111111111111111111"},
{-1 << 63, 2, "-1000000000000000000000000000000000000000000000000000000000000000"},
{16, 17, "g"}, {16, 17, "g"},
{25, 25, "10"}, {25, 25, "10"},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment