Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

Commit b8635ad

Browse files
authored
fix JuliaLang/julia#32046, Error test result from test_logs (JuliaLang/julia#32052)
1 parent 9ac003f commit b8635ad

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/logging.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ macro test_logs(exs...)
169169
$(QuoteNode(exs[1:end-1])), logs)
170170
end
171171
catch e
172-
testres = Error(:test_error, $orig_expr, e, catch_backtrace(), $sourceloc)
172+
testres = Error(:test_error, $orig_expr, e, Base.catch_stack(), $sourceloc)
173173
end
174174
Test.record(Test.get_testset(), testres)
175175
value

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,14 @@ end
764764
@test_logs (Warn,) foo(1)
765765
@test_logs (Warn,) match_mode=:any @info "foo"
766766
@test_logs (Debug,) @debug "foo"
767+
@test_logs (Warn,) error()
767768
end
768-
@test length(fails) == 3
769+
@test length(fails) == 4
769770
@test fails[1] isa Test.LogTestFailure
770771
@test fails[2] isa Test.LogTestFailure
771772
@test fails[3] isa Test.LogTestFailure
773+
@test fails[4] isa Test.Error
774+
@test startswith(fails[4].value, "ErrorException")
772775
end
773776

774777
function newfunc()

0 commit comments

Comments
 (0)