Skip to content

Commit c9bdcf1

Browse files
committed
Add values testing for moveaxis
1 parent 43e0148 commit c9bdcf1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

array_api_tests/test_manipulation_functions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_moveaxis(x, data):
173173

174174
ph.assert_dtype("moveaxis", in_dtype=x.dtype, out_dtype=out.dtype)
175175

176-
# Shape testing
176+
177177
_source = sh.normalize_axis(source, x.ndim)
178178
_destination = sh.normalize_axis(destination, x.ndim)
179179

@@ -188,6 +188,12 @@ def test_moveaxis(x, data):
188188
out_shape=out.shape, expected=expected_shape,
189189
kw={"source": source, "destination": destination})
190190

191+
indices = list(sh.ndindex(x.shape))
192+
permuted_indices = [tuple(idx[axis] for axis in new_axes) for idx in indices]
193+
assert_array_ndindex(
194+
"moveaxis", x, x_indices=sh.ndindex(x.shape), out=out, out_indices=permuted_indices
195+
)
196+
191197
@pytest.mark.unvectorized
192198
@given(
193199
x=hh.arrays(

0 commit comments

Comments
 (0)