From dd33570b5975588b10dbfb910c2fac8bb796807a Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Mon, 7 Apr 2008 23:18:47 +0000 Subject: Some more tests for assert_* functions. --- numpy/testing/tests/test_utils.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'numpy/testing/tests/test_utils.py') 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) + -- cgit v1.2.1