summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-05-09 01:24:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-05-09 01:24:14 (GMT)
commitf59c28c93007d3d7e7340703aa5d2360d285abed (patch)
tree3a9441fda0aebadf04ea4e1fbcfe7639840d706b /Lib/test/test_unicode.py
parent5d73c178a80392e876f5cd23fd628a6c8fc5955e (diff)
downloadcpython-f59c28c93007d3d7e7340703aa5d2360d285abed.zip
cpython-f59c28c93007d3d7e7340703aa5d2360d285abed.tar.gz
cpython-f59c28c93007d3d7e7340703aa5d2360d285abed.tar.bz2
unicode_writer_finish() checks string consistency
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 8468fbf..2eadd4d 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1064,6 +1064,10 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual('%f' % INF, 'inf')
self.assertEqual('%F' % INF, 'INF')
+ # PEP 393
+ self.assertEqual('%.1s' % "a\xe9\u20ac", 'a')
+ self.assertEqual('%.2s' % "a\xe9\u20ac", 'a\xe9')
+
def test_startswith_endswith_errors(self):
for meth in ('foo'.startswith, 'foo'.endswith):
with self.assertRaises(TypeError) as cm: