Skip to content

Commit eebdd2e

Browse files
committed
Add more test.
1 parent b912370 commit eebdd2e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/copy.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ end
5858
@test B == A
5959
end
6060
let A = reshape(1:6, 3, 2), B = zeros(8,8)
61-
RA = CartesianIndices(axes(A))
62-
copyto!(B, CartesianIndices((5:7,2:3)), A, RA)
63-
@test B[5:7,2:3] == A
64-
B[5:7,2:3] .= 0
65-
@test all(x->x==0, B)
66-
copyto!(B, CartesianIndices((3:2:7,1:2:3)), A, RA)
67-
@test B[3:2:7,1:2:3] == A
68-
copyto!(B, CartesianIndices((7:-1:5,3:-1:2)), A, CartesianIndices(map(reverse, axes(A))))
69-
@test B[5:7,2:3] == A
61+
RBs = Any[(5:7,2:3), (3:2:7,1:2:3), (6:-1:4,2:-1:1)]
62+
RAs = Any[axes(A), reverse.(axes(A))]
63+
for RB in RBs, RA in RAs
64+
copyto!(B, CartesianIndices(RB), A, CartesianIndices(RA))
65+
display(B)
66+
@test B[RB...] == A[RA...]
67+
B[RB...] .= 0
68+
@test all(iszero, B)
69+
end
7070
end
7171
end
7272

0 commit comments

Comments
 (0)