[Numpy-svn] r4981 - trunk/numpy/testing/tests
numpy-svn at scipy.org
numpy-svn at scipy.org
Mon Apr 7 19:57:45 EDT 2008
Author: cdavid
Date: 2008-04-07 18:57:42 -0500 (Mon, 07 Apr 2008)
New Revision: 4981
Modified:
trunk/numpy/testing/tests/test_utils.py
Log:
assert* funcs test: add generic test for rank1 arrays for all dtype.
Modified: trunk/numpy/testing/tests/test_utils.py
===================================================================
--- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:53:13 UTC (rev 4980)
+++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:57:42 UTC (rev 4981)
@@ -77,3 +77,21 @@
self._test_not_equal(c, b)
+ def test_generic_rank1(self):
+ """Test rank 1 array for all dtypes."""
+ def foo(t):
+ a = N.empty(2, t)
+ a.fill(1)
+ b = a.copy()
+ c = a.copy()
+ c.fill(0)
+ self._test_equal(a, b)
+ self._test_not_equal(c, b)
+
+ # Test numeric types and object
+ for t in '?bhilqpBHILQPfdgFDG':
+ foo(t)
+
+ # Test strings
+ for t in ['S1', 'U1']:
+ foo(t)
More information about the Numpy-svn
mailing list