Merged revisions 64499 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r64499 | eric.smith | 2008-06-24 07:11:59 -0400 (Tue, 24 Jun 2008) | 1 line

  Fixed formatting with thousands separator and padding.  Resolves issue 3140.
........
This commit is contained in:
Eric Smith 2008-06-24 11:21:04 +00:00
parent 6ed16dcf56
commit b151a45a69
2 changed files with 21 additions and 13 deletions

View file

@ -428,6 +428,14 @@ class TypesTests(unittest.TestCase):
# move to the next integer to test
x = x // 10
rfmt = ">20n"
lfmt = "<20n"
cfmt = "^20n"
for x in (1234, 12345, 123456, 1234567, 12345678, 123456789, 1234567890, 12345678900):
self.assertEqual(len(format(0, rfmt)), len(format(x, rfmt)))
self.assertEqual(len(format(0, lfmt)), len(format(x, lfmt)))
self.assertEqual(len(format(0, cfmt)), len(format(x, cfmt)))
def test_float__format__(self):
# these should be rewritten to use both format(x, spec) and
# x.__format__(spec)