Skip to content

Commit

Permalink
fix JuliaLang/julia#32046, Error test result from test_logs (JuliaLan…
Browse files Browse the repository at this point in the history
…g/julia#32052)

(cherry picked from commit b8635ad)
  • Loading branch information
JeffBezanson authored and KristofferC committed May 20, 2019
1 parent bd1b3f8 commit 5b16a87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ macro test_logs(exs...)
$(QuoteNode(exs[1:end-1])), logs)
end
catch e
testres = Error(:test_error, $orig_expr, e, catch_backtrace(), $sourceloc)
testres = Error(:test_error, $orig_expr, e, Base.catch_stack(), $sourceloc)
end
Test.record(Test.get_testset(), testres)
value
Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,14 @@ end
@test_logs (Warn,) foo(1)
@test_logs (Warn,) match_mode=:any @info "foo"
@test_logs (Debug,) @debug "foo"
@test_logs (Warn,) error()
end
@test length(fails) == 3
@test length(fails) == 4
@test fails[1] isa Test.LogTestFailure
@test fails[2] isa Test.LogTestFailure
@test fails[3] isa Test.LogTestFailure
@test fails[4] isa Test.Error
@test startswith(fails[4].value, "ErrorException")
end

function newfunc()
Expand Down

0 comments on commit 5b16a87

Please sign in to comment.