Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r76272:ba1ed3805ad7
Date: 2015-03-07 14:52 +0100
http://bitbucket.org/pypy/pypy/changeset/ba1ed3805ad7/

Log:    Add a test checking we get the exact same result as CPython

diff --git a/pypy/module/_random/test/test_random.py 
b/pypy/module/_random/test/test_random.py
--- a/pypy/module/_random/test/test_random.py
+++ b/pypy/module/_random/test/test_random.py
@@ -102,3 +102,10 @@
                 self.x = x
         r = R(x=15)
         assert r.x == 15
+
+    def test_exact_result(self):
+        # this passes on CPython 2.7.9 on Linux 32 and Linux 64
+        import _random
+        rnd = _random.Random(-3**31)
+        x = rnd.random()
+        assert x == 0.8181851342382107
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to