diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-06-16 00:57:41 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-06-16 00:57:41 (GMT) |
commit | 184252ad3f66fe829aca03386d9ade38ce5aa4c4 (patch) | |
tree | 36b07b9c16441cd243feda7ced5bc38e8370e839 /Lib/test | |
parent | 9a77770add346617c1abcc3d1ad5efa96fc993ce (diff) | |
download | cpython-184252ad3f66fe829aca03386d9ade38ce5aa4c4.zip cpython-184252ad3f66fe829aca03386d9ade38ce5aa4c4.tar.gz cpython-184252ad3f66fe829aca03386d9ade38ce5aa4c4.tar.bz2 |
Fix "%f" format of str%args if the result is not an ASCII or latin1 string
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_format.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py index d43cea3..b6e2540 100644 --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -265,6 +265,8 @@ class FormatTest(unittest.TestCase): raise TestFailed('"%*d"%(maxsize, -127) should fail') def test_non_ascii(self): + testformat("\u20ac=%f", (1.0,), "\u20ac=1.000000") + self.assertEqual(format("abc", "\u2007<5"), "abc\u2007\u2007") self.assertEqual(format(123, "\u2007<5"), "123\u2007\u2007") self.assertEqual(format(12.3, "\u2007<6"), "12.3\u2007\u2007") |