# [Numpy-svn] r3185 - trunk/numpy/lib/tests

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Sep 18 19:21:02 CDT 2006

Author: stefan
Date: 2006-09-18 19:20:56 -0500 (Mon, 18 Sep 2006)
New Revision: 3185

Modified:
trunk/numpy/lib/tests/test_arraysetops.py
Log:
Add tests to arraysetops for empty arrays.

Modified: trunk/numpy/lib/tests/test_arraysetops.py
===================================================================
--- trunk/numpy/lib/tests/test_arraysetops.py	2006-09-19 00:17:10 UTC (rev 3184)
+++ trunk/numpy/lib/tests/test_arraysetops.py	2006-09-19 00:20:56 UTC (rev 3185)
@@ -21,6 +21,8 @@
ec = numpy.array( [1, 2, 5, 7] )
c = unique1d( a )
assert_array_equal( c, ec )
+
+        assert_array_equal([], unique1d([]))

##
# 03.11.2005, c
@@ -32,6 +34,8 @@
ec = numpy.array( [1, 2, 5] )
c = intersect1d( a, b )
assert_array_equal( c, ec )
+
+        assert_array_equal([], intersect1d([],[]))

##
# 03.11.2005, c
@@ -43,6 +47,8 @@
ec = numpy.array( [1, 2, 5] )
c = intersect1d_nu( a, b )
assert_array_equal( c, ec )
+
+        assert_array_equal([], intersect1d_nu([],[]))

##
# 03.11.2005, c
@@ -68,6 +74,8 @@
ec = numpy.array( [1, 2, 3, 4, 5, 6] )
c = setxor1d( a, b )
assert_array_equal( c, ec )
+
+        assert_array_equal([], setxor1d([],[]))

def check_ediff1d(self):
zero_elem = numpy.array([])
@@ -101,6 +109,8 @@
ec = numpy.array( [True, False, True, False] )
c = setmember1d( a, b )
assert_array_equal( c, ec )
+
+        assert_array_equal([], setmember1d([],[]))

##
# 03.11.2005, c
@@ -112,6 +122,8 @@
ec = numpy.array( [1, 2, 3, 4, 5, 7] )
c = union1d( a, b )
assert_array_equal( c, ec )
+
+        assert_array_equal([], union1d([],[]))

##
# 03.11.2005, c
@@ -130,6 +142,8 @@
ec = numpy.array( [19, 20] )
c = setdiff1d( a, b )
assert_array_equal( c, ec )
+
+        assert_array_equal([], setdiff1d([],[]))

##