376
376
{"-10", "%#X", "-0XA"},
377
377
{"10", "%#y", "%!y(big.Int=10)"},
378
378
{"-10", "%#y", "%!y(big.Int=-10)"},
380
{"1234", "%d", "1234"},
381
{"1234", "%3d", "1234"},
382
{"1234", "%4d", "1234"},
383
{"-1234", "%d", "-1234"},
384
{"1234", "% 5d", " 1234"},
385
{"1234", "%+5d", "+1234"},
386
{"1234", "%-5d", "1234 "},
387
{"1234", "%x", "4d2"},
388
{"1234", "%X", "4D2"},
389
{"1234", "% x", "4 d2"},
390
{"-1234", "%3x", "-4d2"},
391
{"-1234", "%4x", "-4d2"},
392
{"-1234", "%5x", " -4d2"},
393
{"-1234", "%-5x", "-4d2 "},
394
{"-1234", "% x", "-4 d2"},
395
{"1234", "%03d", "1234"},
396
{"1234", "%04d", "1234"},
397
{"1234", "%05d", "01234"},
398
{"1234", "%06d", "001234"},
399
{"-1234", "%06d", "-01234"},
400
{"1234", "%+06d", "+01234"},
401
{"1234", "% 06d", " 01234"},
402
{"1234", "%-6d", "1234 "},
403
{"1234", "%-06d", "001234"},
404
{"-1234", "%-06d", "-01234"},
405
{"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", // 10**100
407
"12 49 ad 25 94 c3 7c eb 0b 27 84 c4 ce 0b f3 8a ce 40 8e 21 1a 7c aa b2 43 08 a8 2e 8f 10 00 00 00 00 00 00 00 00 00 00 00 00"},
392
421
output := fmt.Sprintf(test.format, x)
393
422
if output != test.output {
394
t.Errorf("#%d got %s; want %s", i, output, test.output)
423
t.Errorf("#%d got %q; want %q", i, output, test.output)