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

fijal at codespeak.net fijal at codespeak.net
Mon Mar 19 12:07:05 CET 2007


Author: fijal
Date: Mon Mar 19 12:07:04 2007
New Revision: 40759

Modified:
   pypy/dist/pypy/translator/js/test/test_rfloat.py
Log:
Easy fix :)


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	Mon Mar 19 12:07:04 2007
@@ -2,7 +2,23 @@
 import py
 from pypy.translator.js.test.runtest import JsTest
 from pypy.rpython.test.test_rfloat import BaseTestRfloat
+from pypy.rlib.rarithmetic import r_uint, r_longlong
 
 class TestJsFloat(JsTest, BaseTestRfloat):
     def test_from_r_uint(self):
         py.test.skip("Not implemented")
+
+    def test_longlong_conversion(self):
+        def fn(f):
+            return r_longlong(f)
+
+        res = self.interpret(fn, [1.0])
+        assert res == 1
+        #assert self.is_of_type(res, r_longlong)
+        res = self.interpret(fn, [2.34])
+        assert res == fn(2.34) 
+        big = float(0x7fffffffffffffff)
+        x = big - 1.e10
+        assert x != big
+        y = fn(x)
+        assert fn(x) == 9223372026854775808



More information about the Pypy-commit mailing list