[pypy-svn] r47199 - pypy/branch/kill-keepalives-again/pypy/rpython/memory/gctransform/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Fri Oct 5 19:10:23 CEST 2007
Author: cfbolz
Date: Fri Oct 5 19:10:21 2007
New Revision: 47199
Modified:
pypy/branch/kill-keepalives-again/pypy/rpython/memory/gctransform/test/test_transform.py
Log:
fix the test to not have gced arguments any more
Modified: pypy/branch/kill-keepalives-again/pypy/rpython/memory/gctransform/test/test_transform.py
==============================================================================
--- pypy/branch/kill-keepalives-again/pypy/rpython/memory/gctransform/test/test_transform.py (original)
+++ pypy/branch/kill-keepalives-again/pypy/rpython/memory/gctransform/test/test_transform.py Fri Oct 5 19:10:21 2007
@@ -76,21 +76,22 @@
assert res == f(10)
def test_str(self):
- from pypy.annotation.model import SomeString
- from pypy.rpython.lltypesystem.rstr import string_repr
+ from pypy.annotation.model import SomeBool
- def f(x):
+ def f(flag):
+ if flag:
+ x = 'a'
+ else:
+ x = 'brrrrrrr'
return len(x + 'a')
- llinterp, graph = self.llinterpreter_for_transformed_graph(f, [SomeString()])
+ llinterp, graph = self.llinterpreter_for_transformed_graph(f, [SomeBool()])
- cc = string_repr.convert_const
-
- res = llinterp.eval_graph(graph, [cc('a')])
- assert res == f('a')
- res = llinterp.eval_graph(graph, [cc('brrrrrr')])
- assert res == f('brrrrrr')
+ res = llinterp.eval_graph(graph, [True])
+ assert res == f(True)
+ res = llinterp.eval_graph(graph, [False])
+ assert res == f(False)
class _TestGCTransformer(BaseGCTransformer):
More information about the Pypy-commit
mailing list