[pypy-svn] r48635 - pypy/branch/more-unicode-improvements/pypy/rlib/test

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Nov 13 10:50:38 CET 2007


Author: cfbolz
Date: Tue Nov 13 10:50:37 2007
New Revision: 48635

Modified:
   pypy/branch/more-unicode-improvements/pypy/rlib/test/test_runicode.py
Log:
make the test more reliable: don't let CPython's unmarshaller renormalize the
string when reloading it from a pyc file.


Modified: pypy/branch/more-unicode-improvements/pypy/rlib/test/test_runicode.py
==============================================================================
--- pypy/branch/more-unicode-improvements/pypy/rlib/test/test_runicode.py	(original)
+++ pypy/branch/more-unicode-improvements/pypy/rlib/test/test_runicode.py	Tue Nov 13 10:50:37 2007
@@ -161,8 +161,14 @@
         # check every number of bytes per char
         for s in ["\xd7\x90", "\xd6\x96", "\xeb\x96\x95", "\xf0\x90\x91\x93"]:
             self.checkencode(s, "utf-8")
+
+    def test_utf8_surrogates(self):
         # check replacing of two surrogates by single char while encoding
-        self.checkencode(u"\ud800\udc10", "utf-8")
+        # make sure that the string itself is not marshalled
+        u = u"\ud800" 
+        for i in range(4):
+            u += u"\udc00"
+        self.checkencode(u, "utf-8")
 
     def test_ascii_error(self):
         self.checkencodeerror(u"abc\xFF\xFF\xFFcde", "ascii", 3, 6)



More information about the Pypy-commit mailing list