[pypy-commit] pypy py3k: expand this test, and add a reference to the relevant PEP

antocuni noreply at buildbot.pypy.org
Mon Mar 19 18:02:54 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r53802:d93b0bd03f87
Date: 2012-03-19 16:33 +0100
http://bitbucket.org/pypy/pypy/changeset/d93b0bd03f87/

Log:	expand this test, and add a reference to the relevant PEP

diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -527,8 +527,14 @@
         assert b'\xe1\x80'.decode('utf-8', 'replace') == "\ufffd"
 
     def test_repr_bug(self):
-        assert (repr('\U00090418\u027d\U000582b9\u54c3\U000fcb6e') == 
-                "'\\U00090418\u027d\\U000582b9\u54c3\\U000fcb6e'")
+        # we need to implement PEP 3138 for this to work
+        # http://www.python.org/dev/peps/pep-3138/
+        x = '\u027d'
+        y = "'\u027d'"
+        assert (repr(x) == y)
+        x = '\U00090418\u027d\U000582b9\u54c3\U000fcb6e'
+        y = "'\\U00090418\u027d\\U000582b9\u54c3\\U000fcb6e'"
+        assert (repr(x) == y)
         assert (repr('\n') == 
                 "'\\n'")
 


More information about the pypy-commit mailing list