diff options
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 3cd7cd6bb..c885f49af 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -616,5 +616,12 @@ def compare_results(res,desired): for i in range(len(desired)): assert_array_equal(res[i],desired[i]) +class TestPiecewise(TestCase): + def test_0d(self): + x = array(3) + y = piecewise(x, x>3, [4, 0]) + assert y.ndim == 0 + assert y == 0 + if __name__ == "__main__": nose.run(argv=['', __file__]) |