From 2442a25c3f17152d0e0a01b4e4e95373906e3d90 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Sun, 2 May 2021 18:30:39 +0200 Subject: [PATCH] fix tests on Julia nightly adapt to https://github.com/JuliaLang/julia/pull/38379 --- test/rule_definition_tools.jl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/rule_definition_tools.jl b/test/rule_definition_tools.jl index a4cd38f1b..dd2e2a7a0 100644 --- a/test/rule_definition_tools.jl +++ b/test/rule_definition_tools.jl @@ -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