Skip to content

Commit 37b9639

Browse files
committed
add tests for error messages
1 parent 2786583 commit 37b9639

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,12 @@ end
142142
@test_throws Exception Shape("Circle")
143143
@test_throws Exception convert(Shape, "Circle")
144144
end
145+
146+
struct Bad end
147+
@testset "Error messages" begin
148+
@macroexpand @batteries Bad
149+
@macroexpand @batteries Bad typesalt = 0xb6a4b9eeeb03b58b
150+
@test_throws "`typesalt` must be literally `nothing` or an unsigned integer." @macroexpand @batteries Bad typesalt = "ouch"
151+
@test_throws "Unsupported keyword." @macroexpand @batteries Bad does_not_exist = true
152+
@test_throws "Bad keyword argument value" @macroexpand @batteries Bad hash=:nonsense
153+
end

0 commit comments

Comments
 (0)