[pypy-svn] rev 660 - pypy/trunk/src/pypy/interpreter/test

mwh at codespeak.net mwh at codespeak.net
Thu May 29 14:17:05 CEST 2003


Author: mwh
Date: Thu May 29 14:17:04 2003
New Revision: 660

Modified:
   pypy/trunk/src/pypy/interpreter/test/test_extmodule.py
Log:
test for make_builtin_func -- more to follow


Modified: pypy/trunk/src/pypy/interpreter/test/test_extmodule.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/test/test_extmodule.py	(original)
+++ pypy/trunk/src/pypy/interpreter/test/test_extmodule.py	Thu May 29 14:17:04 2003
@@ -70,5 +70,23 @@
             'somedata': BM_with_appdata.somedata} )
         self.assertEqual(thedata, 'twentythree')
 
+
+class TestPyBuiltinCode(testsupport.TestCase):
+
+    def setUp(self):
+        self.space = testsupport.objspace()
+
+    def tearDown(self):
+        pass
+
+    def test_simple(self):
+        def f(w_x):
+            return w_x
+        builtin_f = extmodule.make_builtin_func(self.space, f)
+        w_input = self.space.wrap(42)
+        w_res = self.space.call_function(builtin_f, w_input)
+        self.assertEqual_w(w_res, w_input)
+
+
 if __name__ == '__main__':
     testsupport.main()


More information about the Pypy-commit mailing list