Skip to content

Commit

Permalink
fix tests on Julia nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed May 2, 2021
1 parent fe69977 commit 2442a25
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/rule_definition_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ macro test_macro_throws(err_expr, expr)
err = nothing
try
@macroexpand($(esc(expr)))
catch load_err
# all errors thrown at macro expansion time are LoadErrors, we need to unwrap
@assert load_err isa LoadError
err = load_err.error
catch _err
# https://github.com/JuliaLang/julia/pull/38379
if VERSION >= v"1.7.0-DEV.937"
err = _err
else
# all errors thrown at macro expansion time are LoadErrors, we need to unwrap
@assert _err isa LoadError
err = _err.error
end
end
# Reuse `@test_throws` logic
if err!==nothing
Expand Down

0 comments on commit 2442a25

Please sign in to comment.