105105 @test StructArrays. strip_params (Tuple{Int}) == Tuple
106106 @test StructArrays. astuple (NamedTuple{(:a ,), Tuple{Float64}}) == Tuple{Float64}
107107 @test StructArrays. strip_params (NamedTuple{(:a ,), Tuple{Float64}}) == NamedTuple{(:a ,)}
108+
109+ cols = (a= rand (2 ), b= rand (2 ), c= rand (2 ))
110+ @test StructArrays. findconsistentvalue (length, cols) == 2
111+ @test StructArrays. findconsistentvalue (length, Tuple (cols)) == 2
112+
113+ cols = (a= rand (2 ), b= rand (2 ), c= rand (3 ))
114+ @test isnothing (StructArrays. findconsistentvalue (length, cols))
115+ @test isnothing (StructArrays. findconsistentvalue (length, Tuple (cols)))
108116end
109117
110118@testset " indexstyle" begin
439447 @test isequal (t. a, [1 , missing ])
440448 @test eltype (t) <: NamedTuple{(:a,)}
441449
442- @test_throws ErrorException StructArray ([nothing ])
443- @test_throws ErrorException StructArray ([1 , 2 , 3 ])
450+ @test_throws ArgumentError StructArray ([nothing ])
451+ @test_throws ArgumentError StructArray ([1 , 2 , 3 ])
444452end
445453
446454@testset " tuple case" begin
@@ -460,10 +468,10 @@ end
460468 @test getproperty (t, 1 ) == [2 ]
461469 @test getproperty (t, 2 ) == [3.0 ]
462470
463- @test_throws ErrorException StructArray (([1 , 2 ], [3 ]))
471+ @test_throws ArgumentError StructArray (([1 , 2 ], [3 ]))
464472
465- @test_throws ErrorException StructArray {Tuple{}} (())
466- @test_throws ErrorException StructArray {Tuple{}, 1, Tuple{}} (())
473+ @test_throws ArgumentError StructArray {Tuple{}} (())
474+ @test_throws ArgumentError StructArray {Tuple{}, 1, Tuple{}} (())
467475end
468476
469477@testset " constructor from slices" begin
503511 @test t1 == StructArray ((a= [1.2 ], b= [" test" ]))
504512 @test t2 == StructArray {Pair{Float64, String}} (([1.2 ], [" test" ]))
505513
506- @test_throws ErrorException StructArray (a= [1 , 2 ], b= [3 ])
514+ @test_throws ArgumentError StructArray (a= [1 , 2 ], b= [3 ])
507515end
508516
509517@testset " complex" begin
0 commit comments