Skip to content

Commit 0e0b34f

Browse files
committed
Add unit test
1 parent a13eec1 commit 0e0b34f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_indexing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ def test_orthogonal_indexing_fallback_on_getitem_2d(
424424
np.testing.assert_array_equal(z[index], expected_result)
425425

426426

427+
def test_setitem_repeated_index():
428+
array = zarr.array(data=np.zeros((4,)), chunks=(1,))
429+
indexer = np.array([-1, -1, 0, 0])
430+
array.oindex[(indexer,)] = [0, 1, 2, 3]
431+
np.testing.assert_array_equal(array[:], np.array([3, 0, 0, 1]))
432+
433+
427434
Index = list[int] | tuple[slice | int | list[int], ...]
428435

429436

0 commit comments

Comments
 (0)