Skip to content

Commit 275fdba

Browse files
Added tests based on division by zero test failure
1 parent 6054b1f commit 275fdba

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dpctl/tests/test_usm_ndarray_manipulation.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,20 @@ def test_roll_out_bounds_shifts():
666666
expected = dpt.roll(x, 2)
667667
assert dpt.all(y == expected)
668668

669+
x_empty = x[1:1]
670+
y = dpt.roll(x_empty, 11)
671+
assert y.size == 0
672+
673+
x_2d = dpt.reshape(x, (2, 2))
674+
y = dpt.roll(x_2d, np.uint64(2**63 + 1), axis=1)
675+
expected = dpt.roll(x_2d, 1, axis=1)
676+
assert dpt.all(y == expected)
677+
678+
x_2d_empty = x_2d[:, 1:1]
679+
y = dpt.roll(x_2d_empty, 3, axis=1)
680+
expected = dpt.empty_like(x_2d_empty)
681+
assert dpt.all(y == expected)
682+
669683

670684
def test_roll_validation():
671685
get_queue_or_skip()

0 commit comments

Comments
 (0)