add test for __setitem__
@@ -222,6 +222,37 @@ class TestArrayInvalidIndexAdvGetitem(unittest.TestCase):
'value': 1},
{'shape': (2, 3, 4),
'indexes': (slice(None), [0, -1], [[1, 0], [0, 1], [-1, 1]]), 'value': 1},
+ # empty arrays
+ {'shape': (2, 3, 4), 'indexes': [], 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': [],
+ 'value': numpy.array([1, 1, 1, 1])},
+ {'shape': (2, 3, 4), 'indexes': [],
+ 'value': numpy.random.uniform(size=(3, 4))},
+ {'shape': (2, 3, 4), 'indexes': numpy.array([], dtype=numpy.int32),
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': [[]],
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': numpy.array([[]], dtype=numpy.int32),
+ 'value': numpy.random.uniform(size=(3, 4))},
+ {'shape': (2, 3, 4), 'indexes': [[[]]],
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': [[[[]]]],
+ 'value': 1},
+ {'shape': (2, 3, 4, 5), 'indexes': [[[[]]]],
+ 'value': 1},
+ {'shape': (2, 3, 4, 5), 'indexes': [[[[[]]]]],
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': (slice(None), []),
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': ([], []),
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': numpy.array([], dtype=numpy.bool),
+ 'value': 1},
+ {'shape': (2, 3, 4),
+ 'indexes': (slice(None), numpy.array([], dtype=numpy.bool)),
+ 'value': 1},
+ {'shape': (2, 3, 4), 'indexes': numpy.array([[]], dtype=numpy.bool),
+ 'value': numpy.random.uniform(size=(4,))},
)
@testing.gpu
class TestArrayAdvancedIndexingSetitemScalarValue(unittest.TestCase):
