@@ -37,6 +37,7 @@ using LinearAlgebra: Adjoint, Transpose, dot, mul!, norm
3737using SparseArraysBase: SparseArrayDOK, SparseMatrixDOK, SparseVectorDOK, storedlength
3838using TensorAlgebra: contract
3939using Test: @test , @test_broken , @test_throws , @testset , @inferred
40+ using TestExtras: @constinferred
4041include (" TestBlockSparseArraysUtils.jl" )
4142
4243arrayts = (Array, JLArray)
@@ -137,30 +138,30 @@ arrayts = (Array, JLArray)
137138 end
138139 @testset " blockstype, blocktype" begin
139140 a = arrayt (randn (elt, 2 , 2 ))
140- @test blockstype (a) <: BlockArrays.BlocksView{elt,2}
141+ @test ( @constinferred blockstype (a) ) <: BlockArrays.BlocksView{elt,2}
141142 # TODO : This is difficult to determine just from type information.
142143 @test_broken blockstype (typeof (a)) <: BlockArrays.BlocksView{elt,2}
143- @test blocktype (a) <: SubArray{elt,2,arrayt{elt,2}}
144+ @test ( @constinferred blocktype (a) ) <: SubArray{elt,2,arrayt{elt,2}}
144145 # TODO : This is difficult to determine just from type information.
145146 @test_broken blocktype (typeof (a)) <: SubArray{elt,2,arrayt{elt,2}}
146147
147148 a = BlockSparseMatrix {elt,arrayt{elt,2}} ([1 , 1 ], [1 , 1 ])
148- @test blockstype (a) <: SparseMatrixDOK{arrayt{elt,2}}
149- @test blockstype (typeof (a)) <: SparseMatrixDOK{arrayt{elt,2}}
150- @test blocktype (a) <: arrayt{elt,2}
151- @test blocktype (typeof (a)) <: arrayt{elt,2}
149+ @test ( @constinferred blockstype (a) ) <: SparseMatrixDOK{arrayt{elt,2}}
150+ @test ( @constinferred blockstype (typeof (a) )) <: SparseMatrixDOK{arrayt{elt,2}}
151+ @test ( @constinferred blocktype (a) ) <: arrayt{elt,2}
152+ @test ( @constinferred blocktype (typeof (a) )) <: arrayt{elt,2}
152153
153154 a = BlockArray (arrayt (randn (elt, (2 , 2 ))), [1 , 1 ], [1 , 1 ])
154- @test blockstype (a) === Matrix{arrayt{elt,2 }}
155- @test blockstype (typeof (a)) === Matrix{arrayt{elt,2 }}
156- @test blocktype (a) <: arrayt{elt,2}
157- @test blocktype (typeof (a)) <: arrayt{elt,2}
155+ @test ( @constinferred blockstype (a) ) === Matrix{arrayt{elt,2 }}
156+ @test ( @constinferred blockstype (typeof (a) )) === Matrix{arrayt{elt,2 }}
157+ @test ( @constinferred blocktype (a) ) <: arrayt{elt,2}
158+ @test ( @constinferred blocktype (typeof (a) )) <: arrayt{elt,2}
158159
159160 a = BlockedArray (arrayt (randn (elt, 2 , 2 )), [1 , 1 ], [1 , 1 ])
160- @test blockstype (a) <: BlockArrays.BlocksView{elt,2}
161+ @test ( @constinferred blockstype (a) ) <: BlockArrays.BlocksView{elt,2}
161162 # TODO : This is difficult to determine just from type information.
162163 @test_broken blockstype (typeof (a)) <: BlockArrays.BlocksView{elt,2}
163- @test blocktype (a) <: SubArray{elt,2,arrayt{elt,2}}
164+ @test ( @constinferred blocktype (a) ) <: SubArray{elt,2,arrayt{elt,2}}
164165 # TODO : This is difficult to determine just from type information.
165166 @test_broken blocktype (typeof (a)) <: SubArray{elt,2,arrayt{elt,2}}
166167 end
0 commit comments