@@ -132,8 +132,34 @@ arrayts = (Array, JLArray)
132132 end
133133 end
134134 end
135- @testset " blocktype" begin
136- @test blocktype (arrayt (randn (elt, 2 , 2 ))) <: SubArray{elt,2,arrayt{elt,2}}
135+ @testset " blockstype, blocktype" begin
136+ a = arrayt (randn (elt, 2 , 2 ))
137+ @test blockstype (a) <: BlockArrays.BlocksView{elt,2}
138+ # TODO : This is difficult to determine just from type information.
139+ @test_broken blockstype (typeof (a)) <: BlockArrays.BlocksView{elt,2}
140+ @test blocktype (a) <: SubArray{elt,2,arrayt{elt,2}}
141+ # TODO : This is difficult to determine just from type information.
142+ @test_broken blocktype (typeof (a)) <: SubArray{elt,2,arrayt{elt,2}}
143+
144+ a = BlockSparseMatrix {elt,arrayt{elt,2}} ([1 , 1 ], [1 , 1 ])
145+ @test blockstype (a) <: SparseMatrixDOK{arrayt{elt,2}}
146+ @test blockstype (typeof (a)) <: SparseMatrixDOK{arrayt{elt,2}}
147+ @test blocktype (a) <: arrayt{elt,2}
148+ @test blocktype (typeof (a)) <: arrayt{elt,2}
149+
150+ a = BlockArray (arrayt (randn (elt, (2 , 2 ))), [1 , 1 ], [1 , 1 ])
151+ @test blockstype (a) === Matrix{arrayt{elt,2 }}
152+ @test blockstype (typeof (a)) === Matrix{arrayt{elt,2 }}
153+ @test blocktype (a) <: arrayt{elt,2}
154+ @test blocktype (typeof (a)) <: arrayt{elt,2}
155+
156+ a = BlockedArray (arrayt (randn (elt, 2 , 2 )), [1 , 1 ], [1 , 1 ])
157+ @test blockstype (a) <: BlockArrays.BlocksView{elt,2}
158+ # TODO : This is difficult to determine just from type information.
159+ @test_broken blockstype (typeof (a)) <: BlockArrays.BlocksView{elt,2}
160+ @test blocktype (a) <: SubArray{elt,2,arrayt{elt,2}}
161+ # TODO : This is difficult to determine just from type information.
162+ @test_broken blocktype (typeof (a)) <: SubArray{elt,2,arrayt{elt,2}}
137163 end
138164 @testset " Basics" begin
139165 a = dev (BlockSparseArray {elt} ([2 , 3 ], [2 , 3 ]))
0 commit comments