[pypy-svn] r9388 - in pypy/dist/pypy/interpreter: . test
tismer at codespeak.net
tismer at codespeak.net
Mon Feb 21 18:20:17 CET 2005
Author: tismer
Date: Mon Feb 21 18:20:17 2005
New Revision: 9388
Modified:
pypy/dist/pypy/interpreter/gateway.py
pypy/dist/pypy/interpreter/test/test_gateway.py
Log:
added alternative versions of applevel and related things.
My first trial to extend a given test case gaveproblems for the naming
conventions of app_xxx functions.
We need to talk about this!
Modified: pypy/dist/pypy/interpreter/gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/gateway.py (original)
+++ pypy/dist/pypy/interpreter/gateway.py Mon Feb 21 18:20:17 2005
@@ -589,11 +589,16 @@
app2interp = appdef # backward compatibility
-# app2interp_temp is used for testing mainly
+# the following two will probably get merged into one
class applevel_temp(applevel):
def getwdict(self, space):
return self._builddict(space) # no cache
-def app2interp_temp(func):
+class applevelinterp_temp(applevelinterp):
+ def getwdict(self, space):
+ return self._builddict(space) # no cache
+
+# app2interp_temp is used for testing mainly
+def app2interp_temp(func, applevel_temp=applevel_temp):
""" NOT_RPYTHON """
return appdef(func, applevel_temp)
Modified: pypy/dist/pypy/interpreter/test/test_gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_gateway.py (original)
+++ pypy/dist/pypy/interpreter/test/test_gateway.py Mon Feb 21 18:20:17 2005
@@ -77,6 +77,14 @@
g3 = gateway.app2interp_temp(app_g3)
assert self.space.eq_w(g3(self.space, w('foo'), w('bar')), w('foobar'))
+ def test_app2interp2(self):
+ """same but using transformed code"""
+ w = self.space.wrap
+ def noapp_g3(a, b):
+ return a+b
+ g3 = gateway.app2interp_temp(noapp_g3, gateway.applevelinterp_temp)
+ assert self.space.eq_w(g3(self.space, w('foo'), w('bar')), w('foobar'))
+
def test_interp2app(self):
space = self.space
w = space.wrap
More information about the Pypy-commit
mailing list