diff options
author | David Cournapeau <cournape@gmail.com> | 2008-04-07 23:57:42 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-04-07 23:57:42 +0000 |
commit | ca295deafe01d224fd1f03dc60b2af182c3c6fe1 (patch) | |
tree | a8eafeb59da02f456dc8a0fd16f8df55dca4c748 /numpy/testing/tests/test_utils.py | |
parent | dff402067c11e6bc82ce5cd8c344024f51095551 (diff) | |
download | numpy-ca295deafe01d224fd1f03dc60b2af182c3c6fe1.tar.gz |
assert* funcs test: add generic test for rank1 arrays for all dtype.
Diffstat (limited to 'numpy/testing/tests/test_utils.py')
-rw-r--r-- | numpy/testing/tests/test_utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index 0ce8551c4..5a50a5c72 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -77,3 +77,21 @@ class TestEqual: 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) |