[pypy-commit] pypy utf8-unicode2: Don't actually skip these tests

waedt noreply at buildbot.pypy.org
Tue Jul 8 16:54:56 CEST 2014


Author: Tyler Wade <wayedt at gmail.com>
Branch: utf8-unicode2
Changeset: r72389:62603ec2b980
Date: 2014-07-08 09:54 -0500
http://bitbucket.org/pypy/pypy/changeset/62603ec2b980/

Log:	Don't actually skip these tests

diff --git a/pypy/interpreter/test/test_utf8_codecs.py b/pypy/interpreter/test/test_utf8_codecs.py
--- a/pypy/interpreter/test/test_utf8_codecs.py
+++ b/pypy/interpreter/test/test_utf8_codecs.py
@@ -3,7 +3,7 @@
 import py
 import sys, random
 
-from pypy.interpreter.utf8 import Utf8Str
+from pypy.interpreter.utf8 import Utf8Str, utf8chr
 from pypy.interpreter import utf8_codecs
 
 
@@ -740,12 +740,7 @@
         assert encoder(u'u\u1234', 2, 'replace') == 'u?'
 
 
-# TODO: Do I need to actually skip these?
 class TestTranslation(object):
-    def setup_class(cls):
-        if utf8_codecs.MAXUNICODE != sys.maxunicode:
-            py.test.skip("these tests cannot run on the llinterp")
-
     def test_utf8(self):
         from rpython.rtyper.test.test_llinterp import interpret
         def f(x):
@@ -758,16 +753,10 @@
         assert res
 
     def test_encode_surrogate_pair(self):
-        u = runicode.UNICHR(0xD800) + runicode.UNICHR(0xDC00)
-        if runicode.MAXUNICODE < 65536:
-            # Narrow unicode build, consider utf16 surrogate pairs
-            assert utf8_codecs.unicode_encode_unicode_escape(
-                u, len(u), True) == r'\U00010000'
-            assert utf8_codecs.unicode_encode_raw_unicode_escape(
-                u, len(u), True) == r'\U00010000'
-        else:
-            # Wide unicode build, don't merge utf16 surrogate pairs
-            assert utf8_codecs.unicode_encode_unicode_escape(
-                u, len(u), True) == r'\ud800\udc00'
-            assert utf8_codecs.unicode_encode_raw_unicode_escape(
-                u, len(u), True) == r'\ud800\udc00'
+        u = utf8chr(0xD800) + utf8chr(0xDC00)
+
+        # Wide unicode build, don't merge utf16 surrogate pairs
+        assert utf8_codecs.unicode_encode_unicode_escape(
+            u, len(u), True) == r'\ud800\udc00'
+        assert utf8_codecs.unicode_encode_raw_unicode_escape(
+            u, len(u), True) == r'\ud800\udc00'


More information about the pypy-commit mailing list