Skip to content

Commit

Permalink
fix tests on Julia nightly (#342)
Browse files Browse the repository at this point in the history
adapt to JuliaLang/julia#38379

Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
  • Loading branch information
simeonschaub and oxinabox authored May 2, 2021
1 parent fe69977 commit bda9c71
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/rule_definition_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ 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
# until Julia v1.7
# 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 bda9c71

Please sign in to comment.