Author: Antonio Cuni <[email protected]>
Branch: hpy-ctypespace
Changeset: r98151:be27c10c92d1
Date: 2019-11-23 12:06 +0100
http://bitbucket.org/pypy/pypy/changeset/be27c10c92d1/
Log: fix these two tests which were failing after the change of the repr
diff --git a/rpython/jit/backend/llsupport/test/test_descr.py
b/rpython/jit/backend/llsupport/test/test_descr.py
--- a/rpython/jit/backend/llsupport/test/test_descr.py
+++ b/rpython/jit/backend/llsupport/test/test_descr.py
@@ -426,9 +426,10 @@
#
fielddescr = get_field_arraylen_descr(c0, rstr.STR)
ofs = fielddescr.offset
- assert repr(ofs) == ("< <FieldOffset <GcStruct rpy_string { hash, chars }>"
- " 'chars'> + < ArrayLengthOffset"
- " <Array of Char > > >")
+ assert repr(ofs) == (
+ "< <FieldOffset <GcStruct rpy_string { hash, chars }> 'chars'> "
+ "+ < ArrayLengthOffset <Array of Char "
+ "{'extra_item_after_alloc': 1, 'immutable': True} > > >")
# caching:
assert fielddescr is get_field_arraylen_descr(c0, rstr.STR)
diff --git a/rpython/rtyper/lltypesystem/lltype.py
b/rpython/rtyper/lltypesystem/lltype.py
--- a/rpython/rtyper/lltypesystem/lltype.py
+++ b/rpython/rtyper/lltypesystem/lltype.py
@@ -467,16 +467,16 @@
_str_fields = saferecursive(_str_fields, '...')
def __str__(self):
- hints = str(self._hints) if self._hints else ''
- return "%s of %s %s " % (self.__class__.__name__,
- self._str_fields(),
- hints)
+ hints = (' ' + str(self._hints)) if self._hints else ''
+ return "%s of %s%s " % (self.__class__.__name__,
+ self._str_fields(),
+ hints)
def _short_name(self):
- hints = str(self._hints) if self._hints else ''
- return "%s %s %s" % (self.__class__.__name__,
- self.OF._short_name(),
- hints)
+ hints = (' ' + str(self._hints)) if self._hints else ''
+ return "%s %s%s" % (self.__class__.__name__,
+ self.OF._short_name(),
+ hints)
_short_name = saferecursive(_short_name, '...')
def _container_example(self):
diff --git a/rpython/rtyper/lltypesystem/test/test_rffi.py
b/rpython/rtyper/lltypesystem/test/test_rffi.py
--- a/rpython/rtyper/lltypesystem/test/test_rffi.py
+++ b/rpython/rtyper/lltypesystem/test/test_rffi.py
@@ -840,7 +840,7 @@
interpret(test_ptradd, [])
def test_voidptr():
- assert repr(VOIDP) == "<* Array of void >"
+ assert repr(VOIDP) == "<* Array of void {'nolength': True,
'render_as_void': True} >"
class TestCRffi(BaseTestRffi):
def compile(self, func, args, **kwds):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit