Skip to content

Commit

Permalink
Merge pull request #75 from LCSB-BioCore/mk-aatest
Browse files Browse the repository at this point in the history
allow "evaluated" explanations in `@atest`
  • Loading branch information
exaexa authored May 18, 2023
2 parents 62635eb + 9209e33 commit 4995888
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ 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__)))
end
end
Base.remove_linenums!(result)
quote
$(Test.do_test)($result, $(esc(desc)))
$(Test.do_test)($result, $(esc(nice)))
end
end

Expand Down

0 comments on commit 4995888

Please sign in to comment.