Author: Daniel Roberts <ademan...@gmail.com> Branch: Changeset: r45351:2630c86662b4 Date: 2011-07-04 18:00 -0700 http://bitbucket.org/pypy/pypy/changeset/2630c86662b4/
Log: Added test for name mangling of quasi immutable fields on pbc on ootype. diff --git a/pypy/rpython/ootypesystem/test/test_oopbc.py b/pypy/rpython/ootypesystem/test/test_oopbc.py --- a/pypy/rpython/ootypesystem/test/test_oopbc.py +++ b/pypy/rpython/ootypesystem/test/test_oopbc.py @@ -81,3 +81,18 @@ res = interpret(f, [1], type_system='ootype') assert res == 2 +def test_quasi_immutable(): + class A(object): + _immutable_fields_ = ['x?'] + def __init__(self): + self.x = 3 + def foo(self): + return self.x + + a = A() + + def f(): + return a.foo() + + res = interpret(f, [], type_system='ootype') + assert res == 3 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit