@@ -294,35 +294,35 @@ end
294
294
@test ! ArrayInterfaceCore. indices_do_not_alias (typeof (view (rand (4 ,4 )' , StepRangeLen (1 ,0 ,5 ), 1 : 2 )))
295
295
end
296
296
297
- @testset " indices_to_dims " begin
297
+ @testset " IndicesInfo " begin
298
298
299
299
struct SplatFirst end
300
300
301
301
ArrayInterfaceCore. is_splat_index (:: Type{SplatFirst} ) = true
302
302
303
303
@test @inferred (IndicesInfo (SubArray{Float64, 2 , Vector{Float64}, Tuple{Base. ReshapedArray{Int64, 2 , UnitRange{Int64}, Tuple{}}}, true })) ==
304
- IndicesInfo {(1,),((1,2),),nothing } ()
304
+ IndicesInfo {1, (1,),((1,2),)} ()
305
305
306
- @test @inferred (indices_to_dims ( Tuple{Vector{Int}}, Vector{Int})) == IndicesInfo {(1,), (1,), nothing } ()
306
+ @test @inferred (IndicesInfo {1} (( Tuple{Vector{Int}}))) == IndicesInfo {1, (1,), (1,)} ()
307
307
308
- @test @inferred (indices_to_dims (Tuple{Vector{Int}}, Matrix{Int} )) == IndicesInfo {(:,), (1,), nothing } ()
308
+ @test @inferred (IndicesInfo {2} (Tuple{Vector{Int}})) == IndicesInfo {2, (:,), (1,)} ()
309
309
310
- @test @inferred (indices_to_dims (Tuple{SplatFirst}, Vector{Int} )) == IndicesInfo {(1,), (1,), nothing } ()
310
+ @test @inferred (IndicesInfo {1} (Tuple{SplatFirst})) == IndicesInfo {1, (1,), (1,)} ()
311
311
312
- @test @inferred (indices_to_dims (Tuple{SplatFirst}, Matrix{Int} )) == IndicesInfo {((1,2),), ((1, 2),), nothing } ()
312
+ @test @inferred (IndicesInfo {2} (Tuple{SplatFirst})) == IndicesInfo {2, ((1,2),), ((1, 2),)} ()
313
313
314
- @test @inferred (indices_to_dims (typeof ((:,[CartesianIndex (1 ,1 ),CartesianIndex (1 ,1 )], 1 , ones (Int, 2 , 2 ), :, 1 )), Array{Int, 5 } )) ==
315
- IndicesInfo {(1, (2, 3), 4, 5, 0, 0), (1, 2, 0, (3, 4), 5, 0), nothing } ()
314
+ @test @inferred (IndicesInfo {5} (typeof ((:,[CartesianIndex (1 ,1 ),CartesianIndex (1 ,1 )], 1 , ones (Int, 2 , 2 ), :, 1 )))) ==
315
+ IndicesInfo {5, (1, (2, 3), 4, 5, 0, 0), (1, 2, 0, (3, 4), 5, 0)} ()
316
316
317
- @test @inferred (indices_to_dims (Tuple{Vararg{Int,10 }}, Array{Int, 10 })) ==
318
- IndicesInfo {(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0), nothing } ()
317
+ @test @inferred (IndicesInfo {10} (Tuple{Vararg{Int,10 }})) ==
318
+ IndicesInfo {10, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)} ()
319
319
320
- @test @inferred (indices_to_dims (typeof ((1 , CartesianIndex (2 , 1 ), 2 , CartesianIndex (1 , 2 ), 1 , CartesianIndex (2 , 1 ), 2 )),Array{Int, 10 } )) ==
321
- IndicesInfo {(1, (2, 3), 4, (5, 6), 7, (8, 9), 10), (0, 0, 0, 0, 0, 0, 0), nothing } ()
320
+ @test @inferred (IndicesInfo {10} (typeof ((1 , CartesianIndex (2 , 1 ), 2 , CartesianIndex (1 , 2 ), 1 , CartesianIndex (2 , 1 ), 2 )))) ==
321
+ IndicesInfo {10, (1, (2, 3), 4, (5, 6), 7, (8, 9), 10), (0, 0, 0, 0, 0, 0, 0)} ()
322
322
323
- @test @inferred (indices_to_dims (typeof ((fill (true , 4 , 4 ), 2 , fill (true , 4 , 4 ), 2 , 1 , fill (true , 4 , 4 ), 1 )), Array{Int, 10 } )) ==
324
- IndicesInfo {((1, 2), 3, (4, 5), 6, 7, (8, 9), 10), (1, 0, 2, 0, 0, 3, 0), nothing } ()
323
+ @test @inferred (IndicesInfo {10} (typeof ((fill (true , 4 , 4 ), 2 , fill (true , 4 , 4 ), 2 , 1 , fill (true , 4 , 4 ), 1 )))) ==
324
+ IndicesInfo {10, ((1, 2), 3, (4, 5), 6, 7, (8, 9), 10), (1, 0, 2, 0, 0, 3, 0)} ()
325
325
326
- @test @inferred (indices_to_dims (typeof ((1 , SplatFirst (), 2 , SplatFirst (), CartesianIndex (1 , 1 ))), Array{Int, 10 } )) ==
327
- IndicesInfo {(1, (2, 3, 4, 5, 6), 7, 8, (9, 10)), (0, (1, 2, 3, 4, 5), 0, 6, 0), nothing } ()
326
+ @test @inferred (IndicesInfo {10} (typeof ((1 , SplatFirst (), 2 , SplatFirst (), CartesianIndex (1 , 1 ))))) ==
327
+ IndicesInfo {10, (1, (2, 3, 4, 5, 6), 7, 8, (9, 10)), (0, (1, 2, 3, 4, 5), 0, 6, 0)} ()
328
328
end
0 commit comments