summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_arraysetops.py
diff options
context:
space:
mode:
authorRobert Cimrman <cimrman3@ntc.zcu.cz>2009-06-08 13:25:55 +0000
committerRobert Cimrman <cimrman3@ntc.zcu.cz>2009-06-08 13:25:55 +0000
commit38c8cd601eb65f3fb665095e1c03aa09538804b2 (patch)
tree6e57c87fbdc210ed9ffdb2f68f4b267b1d2da540 /numpy/lib/tests/test_arraysetops.py
parentdfefd500e0975b4bb7211789ee32237f29b60756 (diff)
downloadnumpy-38c8cd601eb65f3fb665095e1c03aa09538804b2.tar.gz
Added setmember1d_nu to arraysetops.
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r--numpy/lib/tests/test_arraysetops.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index c40cf9d20..40bc11f6e 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -102,6 +102,52 @@ class TestAso(TestCase):
assert_array_equal([], setmember1d([],[]))
+ def test_setmember1d_nu(self):
+ a = np.array([5,4,5,3,4,4,3,4,3,5,2,1,5,5])
+ b = [2,3,4]
+
+ ec = [False, True, False, True, True, True, True, True, True, False,
+ True, False, False, False]
+ c = setmember1d_nu(a, b)
+ assert_array_equal(c, ec)
+
+ b = b + [5, 5, 4]
+
+ ec = [True, True, True, True, True, True, True, True, True, True,
+ True, False, True, True]
+ c = setmember1d_nu(a, b)
+ assert_array_equal(c, ec)
+
+ a = np.array([5, 7, 1, 2])
+ b = np.array([2, 4, 3, 1, 5])
+
+ ec = np.array([True, False, True, True])
+ c = setmember1d_nu(a, b)
+ assert_array_equal(c, ec)
+
+ a = np.array([5, 7, 1, 1, 2])
+ b = np.array([2, 4, 3, 3, 1, 5])
+
+ ec = np.array([True, False, True, True, True])
+ c = setmember1d_nu(a, b)
+ assert_array_equal(c, ec)
+
+ a = np.array([5])
+ b = np.array([2])
+
+ ec = np.array([False])
+ c = setmember1d_nu(a, b)
+ assert_array_equal(c, ec)
+
+ a = np.array([5, 5])
+ b = np.array([2, 2])
+
+ ec = np.array([False, False])
+ c = setmember1d_nu(a, b)
+ assert_array_equal(c, ec)
+
+ assert_array_equal(setmember1d_nu([], []), [])
+
def test_union1d( self ):
a = np.array( [5, 4, 7, 1, 2] )
b = np.array( [2, 4, 3, 3, 2, 1, 5] )