[pypy-svn] r28525 - in pypy/dist/pypy/translator/cli: src test

antocuni at codespeak.net antocuni at codespeak.net
Thu Jun 8 15:52:40 CEST 2006


Author: antocuni
Date: Thu Jun  8 15:52:39 2006
New Revision: 28525

Added:
   pypy/dist/pypy/translator/cli/test/test_pbc.py   (contents, props changed)
Modified:
   pypy/dist/pypy/translator/cli/src/pypylib.cs
   pypy/dist/pypy/translator/cli/test/test_class.py
Log:
More gencli tests.



Modified: pypy/dist/pypy/translator/cli/src/pypylib.cs
==============================================================================
--- pypy/dist/pypy/translator/cli/src/pypylib.cs	(original)
+++ pypy/dist/pypy/translator/cli/src/pypylib.cs	Thu Jun  8 15:52:39 2006
@@ -7,15 +7,27 @@
     {
         public static string ToPython(int x)    { return x.ToString(); }
         public static string ToPython(bool x)   { return x.ToString(); }
-        public static string ToPython(double x) { return x.ToString(); }
+        public static string ToPython(double x) { return x.ToString("F"); }
         public static string ToPython(char x)   { return string.Format("'{0}'", x); }
         public static string ToPython(uint x)   { return x.ToString(); }
         public static string ToPython(long x)   { return x.ToString(); }
         public static string ToPython(ulong x)  { return x.ToString(); }
         // XXX: it does not support strings containing "'".
-        public static string ToPython(string x) { return string.Format("'{0}'", x); }
+        public static string ToPython(string x) { 
+            if (x == null)
+                return "None";
+            else
+                return string.Format("'{0}'", x); 
+        }
+
+        public static string ToPython(object x) {
+            if (x == null)
+                return "None";
+            else
+                return x.ToString();
+        }
 
-        public static string ToPython(object obj) 
+        public static string InstanceToPython(object obj) 
         { 
             return string.Format("InstanceWrapper('{0}')", obj.GetType().FullName);
         }

Modified: pypy/dist/pypy/translator/cli/test/test_class.py
==============================================================================
--- pypy/dist/pypy/translator/cli/test/test_class.py	(original)
+++ pypy/dist/pypy/translator/cli/test/test_class.py	Thu Jun  8 15:52:39 2006
@@ -4,4 +4,4 @@
 
 class TestCliClass(CliTest, BaseTestRclass):
     def test_recursive_prebuilt_instance(self):
-        py.test.skip("gencli doesn't support this, yet'")
+        py.test.skip("gencli doesn't support recursive constants, yet")

Added: pypy/dist/pypy/translator/cli/test/test_pbc.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/cli/test/test_pbc.py	Thu Jun  8 15:52:39 2006
@@ -0,0 +1,16 @@
+import py
+from pypy.translator.cli.test.runtest import CliTest
+from pypy.rpython.test.test_rpbc import BaseTestRPBC
+
+class TestCliPBC(CliTest, BaseTestRPBC):
+    def test_call_memoized_cache(self):
+        py.test.skip("gencli doesn't support recursive constants, yet")        
+
+    def test_multiple_specialized_functions(self):
+        py.test.skip("CLI doesn't support string, yet")
+
+    def test_specialized_method_of_frozen(self):
+        py.test.skip("CLI doesn't support string, yet")
+
+    def test_specialized_method(self):
+        py.test.skip("CLI doesn't support string, yet")



More information about the Pypy-commit mailing list