Skip to content

Commit 2442a25

Browse files
committed
fix tests on Julia nightly
adapt to JuliaLang/julia#38379
1 parent fe69977 commit 2442a25

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/rule_definition_tools.jl

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ macro test_macro_throws(err_expr, expr)
77
err = nothing
88
try
99
@macroexpand($(esc(expr)))
10-
catch load_err
11-
# all errors thrown at macro expansion time are LoadErrors, we need to unwrap
12-
@assert load_err isa LoadError
13-
err = load_err.error
10+
catch _err
11+
# https://github.com/JuliaLang/julia/pull/38379
12+
if VERSION >= v"1.7.0-DEV.937"
13+
err = _err
14+
else
15+
# all errors thrown at macro expansion time are LoadErrors, we need to unwrap
16+
@assert _err isa LoadError
17+
err = _err.error
18+
end
1419
end
1520
# Reuse `@test_throws` logic
1621
if err!==nothing

0 commit comments

Comments
 (0)