summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2008-07-16 00:15:35 (GMT)
committerEric Smith <eric@trueblade.com>2008-07-16 00:15:35 (GMT)
commitd68af8f7431790ac6b74887ccd2a1dcdbae3bdeb (patch)
treeb3fbd7875e9595178f35f0352cdcb72a8c46f802 /Lib
parentf70e195927d475b6cc522f8c9ee51f5db97f7e0c (diff)
downloadcpython-d68af8f7431790ac6b74887ccd2a1dcdbae3bdeb.zip
cpython-d68af8f7431790ac6b74887ccd2a1dcdbae3bdeb.tar.gz
cpython-d68af8f7431790ac6b74887ccd2a1dcdbae3bdeb.tar.bz2
Merged revisions 64984 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r64984 | eric.smith | 2008-07-15 20:11:49 -0400 (Tue, 15 Jul 2008) | 1 line Complete issue 3083: add alternate (#) formatting to bin, oct, hex in str.format(). ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_types.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 360cfe4..1b8e605 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -301,7 +301,8 @@ class TypesTests(unittest.TestCase):
test(-1, "-#5b", ' -0b1')
test(1, "+#5b", ' +0b1')
test(100, "+#b", '+0b1100100')
-# test(100, "#012b", '0b001100100')
+ test(100, "#012b", '0b0001100100')
+ test(-100, "#012b", '-0b001100100')
test(0, "#o", '0o0')
test(0, "-#o", '0o0')
@@ -310,6 +311,8 @@ class TypesTests(unittest.TestCase):
test(-1, "-#5o", ' -0o1')
test(1, "+#5o", ' +0o1')
test(100, "+#o", '+0o144')
+ test(100, "#012o", '0o0000000144')
+ test(-100, "#012o", '-0o000000144')
test(0, "#x", '0x0')
test(0, "-#x", '0x0')
@@ -318,6 +321,10 @@ class TypesTests(unittest.TestCase):
test(-1, "-#5x", ' -0x1')
test(1, "+#5x", ' +0x1')
test(100, "+#x", '+0x64')
+ test(100, "#012x", '0x0000000064')
+ test(-100, "#012x", '-0x000000064')
+ test(123456, "#012x", '0x000001e240')
+ test(-123456, "#012x", '-0x00001e240')
test(0, "#X", '0X0')
test(0, "-#X", '0X0')
@@ -326,6 +333,10 @@ class TypesTests(unittest.TestCase):
test(-1, "-#5X", ' -0X1')
test(1, "+#5X", ' +0X1')
test(100, "+#X", '+0X64')
+ test(100, "#012X", '0X0000000064')
+ test(-100, "#012X", '-0X000000064')
+ test(123456, "#012X", '0X000001E240')
+ test(-123456, "#012X", '-0X00001E240')
# make sure these are errors