[pypy-svn] r36580 - pypy/dist/pypy/rpython/test
fijal at codespeak.net
fijal at codespeak.net
Fri Jan 12 15:53:03 CET 2007
Author: fijal
Date: Fri Jan 12 15:52:59 2007
New Revision: 36580
Modified:
pypy/dist/pypy/rpython/test/test_extfunc.py
Log:
Add passing test
Modified: pypy/dist/pypy/rpython/test/test_extfunc.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_extfunc.py (original)
+++ pypy/dist/pypy/rpython/test/test_extfunc.py Fri Jan 12 15:52:59 2007
@@ -49,3 +49,27 @@
res = interpret(f, [])
assert res == 7
+
+def d(y):
+ return eval("y()")
+
+class DTestFuncEntry(ExtFuncEntry):
+ _about_ = d
+ name = 'd'
+ signature_args = [annmodel.SomeGenericCallable(args=[], result=
+ annmodel.SomeFloat())]
+ signature_result = annmodel.SomeFloat()
+
+def test_callback():
+ def callback():
+ return 2.5
+
+ def f():
+ return d(callback)
+
+ policy = AnnotatorPolicy()
+ policy.allow_someobjects = False
+ a = RPythonAnnotator(policy=policy)
+ s = a.build_types(f, [])
+ assert isinstance(s, annmodel.SomeFloat)
+ assert a.translator._graphof(callback)
More information about the Pypy-commit
mailing list