Skip to content

Commit d3901c6

Browse files
authored
more thorough error testing (#245)
1 parent 01dd3e3 commit d3901c6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/structarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct StructArray{T, N, C<:Tup, I} <: AbstractArray{T, N}
1414
components::C
1515

1616
function StructArray{T, N, C}(c) where {T, N, C<:Tup}
17-
isempty(c) && error("Only eltypes with fields are supported")
17+
isempty(c) && error("only eltypes with fields are supported")
1818
ax = axes(first(c))
1919
length(ax) == N || error("wrong number of dimensions")
2020
map(tail(c)) do ci

test/runtests.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ end
434434
@test isequal(t.a, [1, missing])
435435
@test eltype(t) <: NamedTuple{(:a,)}
436436

437-
@test_throws Exception StructArray([nothing])
438-
@test_throws Exception StructArray([1, 2, 3])
437+
@test_throws ErrorException StructArray([nothing])
438+
@test_throws ErrorException StructArray([1, 2, 3])
439439
end
440440

441441
@testset "tuple case" begin
@@ -456,6 +456,9 @@ end
456456
@test getproperty(t, 2) == [3.0]
457457

458458
@test_throws ErrorException StructArray(([1, 2], [3]))
459+
460+
@test_throws ErrorException StructArray{Tuple{}}(())
461+
@test_throws ErrorException StructArray{Tuple{}, 1, Tuple{}}(())
459462
end
460463

461464
@testset "constructor from slices" begin

0 commit comments

Comments
 (0)