[Scipy-svn] r4553 - trunk/scipy/sandbox/mkufunc/mkufunc

scipy-svn@scip... scipy-svn@scip...
Sat Jul 19 20:00:08 CDT 2008


Author: ilan
Date: 2008-07-19 20:00:07 -0500 (Sat, 19 Jul 2008)
New Revision: 4553

Modified:
   trunk/scipy/sandbox/mkufunc/mkufunc/test_mkufunc.py
Log:
Added test for modulo

Modified: trunk/scipy/sandbox/mkufunc/mkufunc/test_mkufunc.py
===================================================================
--- trunk/scipy/sandbox/mkufunc/mkufunc/test_mkufunc.py	2008-07-19 22:24:45 UTC (rev 4552)
+++ trunk/scipy/sandbox/mkufunc/mkufunc/test_mkufunc.py	2008-07-20 01:00:07 UTC (rev 4553)
@@ -3,7 +3,7 @@
 
 from numpy import array, arange, allclose
 
-from mkufunc.api import Cfunc, genufunc, mkufunc
+from api import Cfunc, genufunc, mkufunc
 
 
 class Util:
@@ -238,7 +238,15 @@
         x = arange(0, 2, 0.1)
         self.assertClose(uf(x), f(x))
 
+    def test_modulo(self):
+        @mkufunc(int)
+        def f(i):
+            return i % 5
+        
+        self.assert_(all(f(range(7)) == array([0, 1, 2, 3, 4, 0, 1])))
+        self.assert_(all(f(arange(8)) == array([0, 1, 2, 3, 4, 0, 1, 2])))
 
+
 class Control_Flow_Tests(unittest.TestCase):
 
     def test_if(self):



More information about the Scipy-svn mailing list