[pypy-svn] r73103 - in pypy/branch/reduce-instance-size-experiments/pypy/objspace/std: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Mon Mar 29 18:41:08 CEST 2010
Author: cfbolz
Date: Mon Mar 29 18:41:03 2010
New Revision: 73103
Modified:
pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/sharingdict.py
pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/test/test_dictmultiobject.py
Log:
grumble grumble tests grumble grumble
Modified: pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/sharingdict.py
==============================================================================
--- pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/sharingdict.py (original)
+++ pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/sharingdict.py Mon Mar 29 18:41:03 2010
@@ -158,7 +158,7 @@
def impl_setitem_str(self, key, w_value, shadows_type=True):
attr = self.structure.lookup_attribute(key)
if attr is not None:
- attr.setfield(self.space, w_value)
+ attr.setfield(self.entries, w_value)
return
new_structure = self.structure.get_next_structure(key)
self.entries = self.structure.convert_to(new_structure, self.entries)
Modified: pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/test/test_dictmultiobject.py
==============================================================================
--- pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/test/test_dictmultiobject.py (original)
+++ pypy/branch/reduce-instance-size-experiments/pypy/objspace/std/test/test_dictmultiobject.py Mon Mar 29 18:41:03 2010
@@ -37,6 +37,10 @@
space.setitem(d,wk1,wone)
wback = space.getitem(d,wk1)
assert self.space.eq_w(wback,wone)
+ wtwo = space.wrap(2)
+ space.setitem(d,wk1,wtwo)
+ wback = space.getitem(d,wk1)
+ assert self.space.eq_w(wback,wtwo)
def test_delitem(self):
space = self.space
@@ -522,6 +526,14 @@
l[0] = 24
assert a.abc == 12
+ def test_setfield_twice(self):
+ class A(object):
+ pass
+ a = A()
+ a.x = 1
+ a.x = 2
+ assert a.x == 2
+
def test_items(self):
class A(object):
pass
@@ -533,7 +545,7 @@
def setup_class(cls):
cls.space = gettestobjspace(**{"objspace.std.withsharingtaggingdict": True})
-class AppTest_DictSharing(AppTest_DictObject):
+class AppTest_DictSharingTagging(AppTest_DictObject):
def setup_class(cls):
cls.space = gettestobjspace(**{"objspace.std.withsharingtaggingdict": True})
More information about the Pypy-commit
mailing list