Skip to content

Commit ee09c8c

Browse files
authored
Merge pull request #6 from jw3126/typesalt
add tests for error messages
2 parents c1d01ad + 39bcb13 commit ee09c8c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,14 @@ 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+
if VERSION >= v"1.7"
151+
@test_throws "`typesalt` must be literally `nothing` or an unsigned integer." @macroexpand @batteries Bad typesalt = "ouch"
152+
@test_throws "Unsupported keyword." @macroexpand @batteries Bad does_not_exist = true
153+
@test_throws "Bad keyword argument value" @macroexpand @batteries Bad hash=:nonsense
154+
end
155+
end

0 commit comments

Comments
 (0)