Skip to content

Commit

Permalink
TST: Test for a generalized ufunc bug, for zero-sized inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiebe committed Jan 17, 2013
1 parent 12be5b7 commit fa9dbef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions numpy/core/tests/test_ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ def test_innerwt(self):
w = np.arange(300,324).reshape((2,3,4))
assert_array_equal(umt.innerwt(a,b,w), np.sum(a*b*w,axis=-1))

def test_innerwt_empty(self):
"""Test generalized ufunc with zero-sized operands"""
a = np.array([], dtype='f8')
b = np.array([], dtype='f8')
w = np.array([], dtype='f8')
assert_array_equal(umt.innerwt(a,b,w), np.sum(a*b*w,axis=-1))

def test_matrix_multiply(self):
self.compare_matrix_multiply_results(np.long)
self.compare_matrix_multiply_results(np.double)
Expand Down

0 comments on commit fa9dbef

Please sign in to comment.