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

fijal at codespeak.net fijal at codespeak.net
Thu Aug 14 11:25:12 CEST 2008


Author: fijal
Date: Thu Aug 14 11:25:12 2008
New Revision: 57239

Modified:
   pypy/dist/pypy/translator/js/test/test_rfloat.py
Log:
Skip partly this test. Needs more testing infrastructure adaptation


Modified: pypy/dist/pypy/translator/js/test/test_rfloat.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_rfloat.py	(original)
+++ pypy/dist/pypy/translator/js/test/test_rfloat.py	Thu Aug 14 11:25:12 2008
@@ -23,5 +23,24 @@
         y = fn(x)
         assert fn(x) == 9223372026854775808
 
+    def test_float2str(self):
+        def fn(f):
+            return str(f)
+
+        res = self.interpret(fn, [1.5])
+        assert float(self.ll_to_string(res)) == 1.5
+        res = self.interpret(fn, [-1.5])
+        assert float(self.ll_to_string(res)) == -1.5
+        py.test.skip("Partly works, needs adapting testing infrastructure")
+        inf = 1e200 * 1e200
+        nan = inf/inf
+        res = self.interpret(fn, [inf])
+        assert self.ll_to_string(res) == self.inf
+        res = self.interpret(fn, [-inf])
+        assert self.ll_to_string(res) == self.minus_inf
+        res = self.interpret(fn, [nan])
+        assert self.ll_to_string(res) == self.nan
+
+
     def test_r_singlefloat(self):
         py.test.skip("not implemented: single-precision floats")



More information about the Pypy-commit mailing list