summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2008-06-24 11:21:04 (GMT)
committerEric Smith <eric@trueblade.com>2008-06-24 11:21:04 (GMT)
commitb151a45a69fed1d66b21f865e07c7242faf711c8 (patch)
tree0084ba6eacf30db2456a22bf1a37b5f15564da21 /Lib/test
parent6ed16dcf56f47f935ceb6e6493b0d53846163dea (diff)
downloadcpython-b151a45a69fed1d66b21f865e07c7242faf711c8.zip
cpython-b151a45a69fed1d66b21f865e07c7242faf711c8.tar.gz
cpython-b151a45a69fed1d66b21f865e07c7242faf711c8.tar.bz2
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. ........
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_types.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 948e8d4..d7deea0 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -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)