Skip to content

Commit 01ab6bb

Browse files
committed
fix some error messages
1 parent 560b494 commit 01ab6bb

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StructHelpers"
22
uuid = "4093c41a-2008-41fd-82b8-e3f9d02b504f"
33
authors = ["Jan Weidner <[email protected]> and contributors"]
4-
version = "1.1.1"
4+
version = "1.1.2"
55

66
[deps]
77
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"

src/StructHelpers.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ macro batteries(T, kw...)
236236
return esc(ret)
237237
end
238238

239-
function error_parse_single_macro_kw(kw; comment=nothing)
239+
function error_parse_macro_kw(kw; comment=nothing)
240240
msg = """
241-
Excepted a keyword argument of the form name = value.
241+
Expected a keyword argument of the form name = value.
242242
Got $(kw) instead.
243243
"""
244244
if comment !== nothing

test/runtests.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ struct SNoIsEqual; a; end
8989
@test Empty1() !== Empty2()
9090
@test Empty1() != Empty2()
9191
@test hash(Empty1()) != hash(Empty2())
92-
93-
@test_throws Exception @macroexpand @batteries SErrors kwconstructor="true"
94-
@test_throws Exception @macroexpand @batteries SErrors nonsense=true
95-
@macroexpand @batteries SErrors kwconstructor=true
92+
93+
@test_throws "Bad keyword argument value:" @macroexpand @batteries SErrors kwconstructor="true"
94+
@test_throws "Unsupported keyword" @macroexpand @batteries SErrors kwconstructor=true nonsense=true
95+
@test_throws "Expected a keyword argument of the form name = value" @macroexpand @batteries SErrors nonsense
96+
9697

9798
@testset "typesalt" begin
9899
@test hash(Salt1()) === hash(Salt1b())

0 commit comments

Comments
 (0)