Skip to content

Commit 1194195

Browse files
committed
Test reinterpret(reshape, T, view(::MArray, ...) strides as well
1 parent 60e8236 commit 1194195

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,12 +650,18 @@ end
650650

651651
Ar2c = reinterpret(reshape, Complex{Float64}, view(rand(2, 5, 7), :, 2:4, 3:5));
652652
@test @inferred(ArrayInterface.strides(Ar2c)) === (StaticInt(1), 5)
653+
Ar2c_static = reinterpret(reshape, Complex{Float64}, view(@MArray(rand(2, 5, 7)), :, 2:4, 3:5));
654+
@test @inferred(ArrayInterface.strides(Ar2c_static)) === (StaticInt(1), StaticInt(5))
653655

654656
Ac2r = reinterpret(reshape, Float64, view(rand(ComplexF64, 5, 7), 2:4, 3:6));
655657
@test @inferred(ArrayInterface.strides(Ac2r)) === (StaticInt(1), StaticInt(2), 10)
658+
Ac2r_static = reinterpret(reshape, Float64, view(@MMatrix(rand(ComplexF64, 5, 7)), 2:4, 3:6));
659+
@test @inferred(ArrayInterface.strides(Ac2r_static)) === (StaticInt(1), StaticInt(2), StaticInt(10))
656660

657661
Ac2t = reinterpret(reshape, Tuple{Float64,Float64}, view(rand(ComplexF64, 5, 7), 2:4, 3:6));
658662
@test @inferred(ArrayInterface.strides(Ac2t)) === (StaticInt(1), 5)
663+
Ac2t_static = reinterpret(reshape, Tuple{Float64,Float64}, view(@MMatrix(rand(ComplexF64, 5, 7)), 2:4, 3:6));
664+
@test @inferred(ArrayInterface.strides(Ac2t_static)) === (StaticInt(1), StaticInt(5))
659665

660666
end
661667
end

0 commit comments

Comments
 (0)