[pypy-commit] pypy numpypy-ufuncs: improve the test

fijal noreply at buildbot.pypy.org
Thu Jan 19 18:22:56 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpypy-ufuncs
Changeset: r51497:77ac35b7fd12
Date: 2012-01-19 19:22 +0200
http://bitbucket.org/pypy/pypy/changeset/77ac35b7fd12/

Log:	improve the test

diff --git a/pypy/module/micronumpy/test/test_ufuncs.py b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -193,11 +193,15 @@
     def test_floorceil(self):
         from _numpypy import array, floor, ceil
         import math
-        reference = [-2.0, -1.0, 0.0, 1.0, 1.0]
-        a = array([-1.4, -1.0, 0.0, 1.0, 1.4])
+        reference = [-2.0, -2.0, -1.0, 0.0, 1.0, 1.0, 0]
+        a = array([-1.4, -1.5, -1.0, 0.0, 1.0, 1.4, 0.5])
         b = floor(a)
         for i in range(5):
             assert b[i] == reference[i]
+        reference = [-1.0, -1.0, -1.0, 0.0, 1.0, 2.0, 1.0]
+        a = array([-1.4, -1.5, -1.0, 0.0, 1.0, 1.4, 0.5])
+        b = ceil(a)
+        assert (reference == b).all()
         inf = float("inf")
         data = [1.5, 2.9999, -1.999, inf]
         results = [math.floor(x) for x in data]


More information about the pypy-commit mailing list