From b2e9499920405fba11289633135ff44aa0cf27e9 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Wed, 17 May 2023 16:45:12 +0200 Subject: [PATCH 1/2] allow "evaluated" explanations in @atest --- src/common.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common.jl b/src/common.jl index c10ffa8..1979c36 100644 --- a/src/common.jl +++ b/src/common.jl @@ -37,10 +37,10 @@ Test.filter_errors(ts::QuietTestSet) = Test.filter_errors(ts.inner) Test.get_test_counts(ts::QuietTestSet) = Test.get_test_counts(ts.inner) Test.print_counts(ts::QuietTestSet, args...) = Test.print_counts(ts.inner, args...) -macro atest(ex, desc) +macro atest(ex, nice, actually=nothing) result = quote try - $(Test.Returned)($(esc(ex)), nothing, $(QuoteNode(__source__))) + $(Test.Returned)($(esc(ex)), $(esc(actually)), $(QuoteNode(__source__))) catch _e _e isa InterruptException && rethrow() $(Test.Threw)(_e, Base.current_exceptions(), $(QuoteNode(__source__))) @@ -48,7 +48,7 @@ macro atest(ex, desc) end Base.remove_linenums!(result) quote - $(Test.do_test)($result, $(esc(desc))) + $(Test.do_test)($result, $(esc(nice))) end end From 9209e33445f27ae95afc6c2de50e5420aa7ef33e Mon Sep 17 00:00:00 2001 From: exaexa Date: Wed, 17 May 2023 14:59:46 +0000 Subject: [PATCH 2/2] automatic formatting triggered by @exaexa on PR #75 --- src/common.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.jl b/src/common.jl index 1979c36..9a3425e 100644 --- a/src/common.jl +++ b/src/common.jl @@ -37,7 +37,7 @@ Test.filter_errors(ts::QuietTestSet) = Test.filter_errors(ts.inner) Test.get_test_counts(ts::QuietTestSet) = Test.get_test_counts(ts.inner) Test.print_counts(ts::QuietTestSet, args...) = Test.print_counts(ts.inner, args...) -macro atest(ex, nice, actually=nothing) +macro atest(ex, nice, actually = nothing) result = quote try $(Test.Returned)($(esc(ex)), $(esc(actually)), $(QuoteNode(__source__)))