Skip to content

Commit

Permalink
Test: improve robustness of stacktrace scrubbing (#49646)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenity4 authored May 6, 2023
1 parent 9b7d88b commit 6296f57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function test_callsite(bt, file_ts, file_t)
# and only traverse parts of the backtrace which we haven't traversed before.
# The order will always be <internal functions> -> `@test` -> `@testset`.
internal = @something(macrocall_location(bt, @__FILE__), return nothing)
test = internal - 1 + findfirst(ip -> any(frame -> in_file(frame, file_t), StackTraces.lookup(ip)), @view bt[internal:end])::Int
test = internal - 1 + @something(findfirst(ip -> any(frame -> in_file(frame, file_t), StackTraces.lookup(ip)), @view bt[internal:end]), return nothing)
testset = test - 1 + @something(macrocall_location(@view(bt[test:end]), file_ts), return nothing)

# If stacktrace locations differ, include frames until the `@testset` appears.
Expand Down

0 comments on commit 6296f57

Please sign in to comment.