summaryrefslogtreecommitdiff
path: root/numpy/testing/tests/test_utils.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-04-07 23:18:47 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-04-07 23:18:47 +0000
commitdd33570b5975588b10dbfb910c2fac8bb796807a (patch)
tree6dcad5da47f5008f83bd60f7c4e8da9c473549b2 /numpy/testing/tests/test_utils.py
parent640018fac45026b3fd70846c62297bfedac5afa3 (diff)
downloadnumpy-dd33570b5975588b10dbfb910c2fac8bb796807a.tar.gz
Some more tests for assert_* functions.
Diffstat (limited to 'numpy/testing/tests/test_utils.py')
-rw-r--r--numpy/testing/tests/test_utils.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 2347c3762..705027c5c 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -17,14 +17,41 @@ class TestEqual:
raise AssertionError("a and b are found equal but are not")
def test_array_rank1_eq(self):
- """Test two equal array are found equal."""
+ """Test two equal array of rank 1 are found equal."""
a = N.array([1, 2])
b = N.array([1, 2])
self._test_equal(a, b)
def test_array_rank1_noteq(self):
+ """Test two different array of rank 1 are found not equal."""
a = N.array([1, 2])
b = N.array([2, 2])
self._test_not_equal(a, b)
+
+ def test_array_rank2_eq(self):
+ """Test two equal array of rank 2 are found equal."""
+ a = N.array([[1, 2], [3, 4]])
+ b = N.array([[1, 2], [3, 4]])
+
+ self._test_equal(a, b)
+
+ def test_array_diffshape(self):
+ """Test two arrays with different shapes are found not equal."""
+ a = N.array([1, 2])
+ b = N.array([[1, 2], [1, 2]])
+
+ self._test_not_equal(a, b)
+
+ def test_string_arrays(self):
+ """Test two arrays with different shapes are found not equal."""
+ a = N.array(['floupi', 'floupa'])
+ b = N.array(['floupi', 'floupa'])
+
+ self._test_equal(a, b)
+
+ c = N.array(['floupipi', 'floupa'])
+
+ self._test_not_equal(c, b)
+