[pypy-svn] r36104 - pypy/dist/pypy/translator/js/test

fijal at codespeak.net fijal at codespeak.net
Tue Jan 2 15:35:26 CET 2007


Author: fijal
Date: Tue Jan  2 15:35:25 2007
New Revision: 36104

Modified:
   pypy/dist/pypy/translator/js/test/test_basicexternal.py
Log:
Added a test which (suprisingly) passes


Modified: pypy/dist/pypy/translator/js/test/test_basicexternal.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_basicexternal.py	(original)
+++ pypy/dist/pypy/translator/js/test/test_basicexternal.py	Tue Jan  2 15:35:25 2007
@@ -34,18 +34,32 @@
     fun = compile_function(be_fun, [])
     check_source_contains(fun, "\.some_code")
 
-def test_basicexternal_raise():
-    py.test.skip("Constant BasicExternals not implemented")
-    def raising_fun():
-        try:
-            b = B()
-        except:
-            pass
-        else:
-            return 3
+##def test_basicexternal_raise():
+##    #py.test.skip("Constant BasicExternals not implemented")
+##    def raising_fun():
+##        try:
+##            b = B()
+##        except:
+##            pass
+##        else:
+##            return 3
+##
+##    fun = compile_function(raising_fun, [])
+##    assert fun() == 3
+
+class EE(BasicExternal):
+    @described(retval=3)
+    def bb(self):
+        pass
 
-    fun = compile_function(raising_fun, [])
-    assert fun() == 3
+ee = EE()
+
+def test_prebuild_basicexternal():
+    def tt_fun():
+        ee.bb()
+    
+    fun = compile_function(tt_fun, [])
+    check_source_contains(fun, "ee.bb\(")
 
 class C(BasicExternal):
     @described(retval=3)


More information about the pypy-svn mailing list