Skip to content

Commit 444e5ab

Browse files
committed
Add parent_type tests
1 parent 45a5a9c commit 444e5ab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,14 @@ end
162162

163163
using ArrayInterface: zeromatrix
164164
@test zeromatrix(rand(4,4,4)) == zeros(4*4*4,4*4*4)
165+
166+
using ArrayInterface: parent_type
167+
@testset "" begin
168+
x = ones(4, 4)
169+
@test parent_type(view(x, 1:2, 1:2)) <: typeof(x)
170+
@test parent_type(reshape(x, 2, :)) <: typeof(x)
171+
@test parent_type(transpose(x)) <: typeof(x)
172+
@test parent_type(Symmetric(x)) <: typeof(x)
173+
@test parent_type(UpperTriangular(x)) <: typeof(x)
174+
end
175+

0 commit comments

Comments
 (0)