@@ -237,7 +237,7 @@ StructArrays.SkipConstructor(::Type{<:S}) = true
237
237
end
238
238
239
239
const initializer = StructArrays. ArrayInitializer (t -> t <: Union{Tuple, NamedTuple, Pair} )
240
- collect_structarray_rec (t) = StructArrays . collect_structarray (t, initializer = initializer)
240
+ collect_structarray_rec (t) = collect_structarray (t, initializer = initializer)
241
241
242
242
@testset " collectnamedtuples" begin
243
243
v = [(a = 1 , b = 2 ), (a = 1 , b = 3 )]
@@ -255,7 +255,7 @@ collect_structarray_rec(t) = StructArrays.collect_structarray(t, initializer = i
255
255
@test typeof (collect_structarray_rec (v)) == typeof (StructArray ((a = Real[1 , 1.2 ], b = Int[2 , 3 ])))
256
256
257
257
s = StructArray (a = [1 , 2 ], b = [3 , 4 ])
258
- @test StructArrays . collect_structarray (LazyRow (s, i) for i in eachindex (s)) == s
258
+ @test collect_structarray (LazyRow (s, i) for i in eachindex (s)) == s
259
259
@test collect_structarray_rec (LazyRow (s, i) for i in eachindex (s)) == s
260
260
261
261
v = [(a = 1 , b = 2 ), (a = 1.2 , b = " 3" )]
288
288
@test collect_structarray_rec (v) == StructArray ((Int[1 , 1 ], Int[2 , 3 ]))
289
289
@inferred collect_structarray_rec (v)
290
290
291
- @test StructArrays . collect_structarray (v) == StructArray ((Int[1 , 1 ], Int[2 , 3 ]))
292
- @inferred StructArrays . collect_structarray (v)
291
+ @test collect_structarray (v) == StructArray ((Int[1 , 1 ], Int[2 , 3 ]))
292
+ @inferred collect_structarray (v)
293
293
294
294
v = [(1 , 2 ), (1.2 , 3 )]
295
295
@test collect_structarray_rec (v) == StructArray ((Real[1 , 1.2 ], Int[2 , 3 ]))
381
381
382
382
@testset " collect2D" begin
383
383
s = (l for l in [(a= i, b= j) for i in 1 : 3 , j in 1 : 4 ])
384
- v = StructArrays . collect_structarray (s)
384
+ v = collect_structarray (s)
385
385
@test size (v) == (3 , 4 )
386
386
@test v. a == [i for i in 1 : 3 , j in 1 : 4 ]
387
387
@test v. b == [j for i in 1 : 3 , j in 1 : 4 ]
0 commit comments