aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfijal <unknown>2017-11-04 14:38:37 +0100
committerfijal <unknown>2017-11-04 14:38:37 +0100
commitd0b8d0c46b66559a51b0d0c0fe79b2cd3d1e26c4 (patch)
tree749d690a0a1790aeda5311225f8e32f0b9d77230 /pypy/objspace/std/test/test_unicodeobject.py
parent* Return a flag from check_utf8. (diff)
downloadpypy-d0b8d0c46b66559a51b0d0c0fe79b2cd3d1e26c4.tar.gz
pypy-d0b8d0c46b66559a51b0d0c0fe79b2cd3d1e26c4.tar.bz2
pypy-d0b8d0c46b66559a51b0d0c0fe79b2cd3d1e26c4.zip
progress on having flags correctly propagated, almost there
Diffstat (limited to 'pypy/objspace/std/test/test_unicodeobject.py')
-rw-r--r--pypy/objspace/std/test/test_unicodeobject.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py
index a860d1c20a..9620f6e3cc 100644
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -3,6 +3,7 @@
import py
import sys
from hypothesis import given, strategies, settings, example
+from rpython.rlib import rutf8
from pypy.interpreter.error import OperationError
@@ -27,12 +28,12 @@ class TestUnicodeObject:
def test_listview_unicode(self):
py.test.skip("skip for new")
- w_str = self.space.wrap(u'abcd')
+ w_str = self.space.newutf8('abcd', 4, rutf8.FLAG_ASCII)
assert self.space.listview_unicode(w_str) == list(u"abcd")
def test_new_shortcut(self):
space = self.space
- w_uni = self.space.wrap(u'abcd')
+ w_uni = self.space.newutf8('abcd', 4, rutf8.FLAG_ASCII)
w_new = space.call_method(
space.w_unicode, "__new__", space.w_unicode, w_uni)
assert w_new is w_uni
@@ -44,8 +45,8 @@ class TestUnicodeObject:
return # skip this case
v = u[start : start + len1]
space = self.space
- w_u = space.wrap(u)
- w_v = space.wrap(v)
+ w_u = space.newutf8(u.encode('utf8'), len(u), rutf8.FLAG_REGULAR)
+ w_v = space.newutf8(v.encode('utf8'), len(v), rutf8.FLAG_REGULAR)
expected = u.find(v, start, start + len1)
try:
w_index = space.call_method(w_u, 'index', w_v,