From 299b37dbc8bc951662cf0161ba35b4ce070298b2 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 16 Jun 2020 13:44:41 -0500 Subject: [PATCH] Add more test cases --- test/test_array.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/test_array.py b/test/test_array.py index acc818a7..d1e08346 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -1324,13 +1324,15 @@ def test_negative_dim_rejection(ctx_factory): cl_array.Array(queue, shape=-10, dtype=np.float) with pytest.raises(ValueError): - cl_array.Array(queue, shape=(-1, +1), dtype=np.float) + cl_array.Array(queue, shape=(-10,), dtype=np.float) - with pytest.raises(ValueError): - cl_array.Array(queue, shape=(+1, -1), dtype=np.float) + for left_dim in (-1, 0, 1): + with pytest.raises(ValueError): + cl_array.Array(queue, shape=(left_dim, -1), dtype=np.float) - with pytest.raises(ValueError): - cl_array.Array(queue, shape=(-1, -1), dtype=np.float) + for right_dim in (-1, 0, 1): + with pytest.raises(ValueError): + cl_array.Array(queue, shape=(-1, right_dim), dtype=np.float) if __name__ == "__main__": -- GitLab