~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/big/int_test.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
376
376
        {"-10", "%#X", "-0XA"},
377
377
        {"10", "%#y", "%!y(big.Int=10)"},
378
378
        {"-10", "%#y", "%!y(big.Int=-10)"},
 
379
 
 
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
 
406
                "% x",
 
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"},
379
408
}
380
409
 
381
410
 
391
420
                }
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)
395
424
                }
396
425
        }
397
426
}