Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bouweandela committed Jan 11, 2024
1 parent 6e2e81f commit c2265d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/iris/tests/unit/util/test_array_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,15 @@ def test_string_arrays_0d_and_scalar(self):
self.assertFalse(array_equal(array_a, "foobar."))

def test_nan_equality_nan_ne_nan(self):
array = np.array([1.0, np.nan, 2.0, np.nan, 3.0])
self.assertFalse(array_equal(array, array))
array_a = np.array([1.0, np.nan, 2.0, np.nan, 3.0])
array_b = array_a.copy()
self.assertFalse(array_equal(array_a, array_a))
self.assertFalse(array_equal(array_a, array_b))

def test_nan_equality_nan_naneq_nan(self):
array_a = np.array([1.0, np.nan, 2.0, np.nan, 3.0])
array_b = np.array([1.0, np.nan, 2.0, np.nan, 3.0])
self.assertTrue(array_equal(array_a, array_a, withnans=True))
self.assertTrue(array_equal(array_a, array_b, withnans=True))

def test_nan_equality_nan_nanne_a(self):
Expand Down

0 comments on commit c2265d4

Please sign in to comment.