[pypy-svn] r15860 - pypy/dist/pypy/rpython/test
arigo at codespeak.net
arigo at codespeak.net
Tue Aug 9 21:26:31 CEST 2005
Author: arigo
Date: Tue Aug 9 21:26:29 2005
New Revision: 15860
Modified:
pypy/dist/pypy/rpython/test/test_rbuiltin.py
Log:
Test case for a bug shown by translate_pypy.
Modified: pypy/dist/pypy/rpython/test/test_rbuiltin.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rbuiltin.py (original)
+++ pypy/dist/pypy/rpython/test/test_rbuiltin.py Tue Aug 9 21:26:29 2005
@@ -228,3 +228,22 @@
return s1 + s2
res = interpret(f, [])
assert ''.join(list(res.chars)) == 'abc, def123'
+
+def INPROGRESS_test_method_repr():
+ def g(n):
+ if n >= 0:
+ return "egg"
+ else:
+ return "spam"
+ def f(n):
+ # this is designed for a specific bug: conversions between
+ # BuiltinMethodRepr. The append method of the list is passed
+ # around, and g(-1) below causes a reflowing at the beginning
+ # of the loop (but not inside the loop). This situation creates
+ # a newlist returning a SomeList() which '==' but 'is not' the
+ # SomeList() inside the loop.
+ x = len([ord(c) for c in g(1)])
+ g(-1)
+ return x
+ res = interpret(f, [0])
+ assert res == 3
More information about the Pypy-commit
mailing list