[pypy-svn] r56937 - pypy/branch/garden-call-code/pypy/interpreter/test
pedronis at codespeak.net
pedronis at codespeak.net
Sat Aug 2 20:05:36 CEST 2008
Author: pedronis
Date: Sat Aug 2 20:05:34 2008
New Revision: 56937
Modified:
pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py
Log:
test covering various situations for BuiltinCode.funcrun
Modified: pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py
==============================================================================
--- pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py (original)
+++ pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py Sat Aug 2 20:05:34 2008
@@ -509,4 +509,32 @@
w_res = space.call_obj_args(w_g, w_self, args3)
assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 3))))
# white-box check for opt
- assert called[0] is args3
+ assert called[0] is args3
+
+ def test_plain(self):
+ space = self.space
+
+ def g(space, w_a, w_x):
+ return space.newtuple([space.wrap('g'), w_a, w_x])
+
+ w_g = space.wrap(gateway.interp2app_temp(g,
+ unwrap_spec=[gateway.ObjSpace,
+ gateway.W_Root,
+ gateway.W_Root]))
+
+ args = argument.Arguments(space, [space.wrap(-1), space.wrap(0)])
+
+ w_res = space.call_args(w_g, args)
+ assert space.is_true(space.eq(w_res, space.wrap(('g', -1, 0))))
+
+ w_self = space.wrap('self')
+
+ args0 = argument.Arguments(space, [space.wrap(0)])
+ args = args0.prepend(w_self)
+
+ w_res = space.call_args(w_g, args)
+ assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 0))))
+
+ args3 = argument.Arguments(space, [space.wrap(3)])
+ w_res = space.call_obj_args(w_g, w_self, args3)
+ assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 3))))
More information about the Pypy-commit
mailing list