From c437fc462a7cc2e1ca213655a9aeaeeea8bafece Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 12 Jul 2017 03:29:43 -0500 Subject: [PATCH] Better failure diagnostics for error paths in replutil tests --- test/replutil.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/replutil.jl b/test/replutil.jl index 9f4d30aa120a3..39451b44c05c3 100644 --- a/test/replutil.jl +++ b/test/replutil.jl @@ -182,13 +182,14 @@ macro except_str(expr, err_type) end macro except_strbt(expr, err_type) + errmsg = "expected failure, but no exception thrown for $expr" return quote let err = nothing try $(esc(expr)) catch err end - err === nothing && error("expected failure, but no exception thrown") + err === nothing && error($errmsg) @test typeof(err) === $(esc(err_type)) buf = IOBuffer() showerror(buf, err, catch_backtrace())