summaryrefslogtreecommitdiff
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-03-17 18:01:03 +0000
committerMark Dickinson <dickinsm@gmail.com>2009-03-17 18:01:03 +0000
commitb065e52bc284c2c28a967c4e82aa7ece6d09c562 (patch)
tree446dec7a95dafe2d40c85f89ae0fb1aa9fc076a3 /Lib/test/test_decimal.py
parent8cbe9556cf4ad10c0ee2636f43f4f3675a8c6203 (diff)
downloadcpython-git-b065e52bc284c2c28a967c4e82aa7ece6d09c562.tar.gz
Fix bug in Decimal __format__ method that swapped left and right
alignment.
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 65aa033225..eed1eed081 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -704,6 +704,12 @@ class DecimalFormatTest(unittest.TestCase):
('.0g', '-sNaN', '-sNaN'),
('', '1.00', '1.00'),
+
+ # check alignment
+ ('<6', '123', '123 '),
+ ('>6', '123', ' 123'),
+ ('^6', '123', ' 123 '),
+ ('=+6', '123', '+ 123'),
]
for fmt, d, result in test_values:
self.assertEqual(format(Decimal(d), fmt), result)