Skip to content

Commit

Permalink
test: make errorshow test more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Sep 14, 2021
1 parent 2f47dae commit 8f0b17b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ end

# Test that implementation detail of include() is hidden from the user by default
let bt = try
include("testhelpers/include_error.jl")
@noinline include("testhelpers/include_error.jl")
catch
catch_backtrace()
end
Expand All @@ -740,7 +740,7 @@ end
# Test backtrace printing
module B
module C
f(x; y=2.0) = error()
@noinline f(x; y=2.0) = error()
end
module D
import ..C: f
Expand All @@ -749,7 +749,8 @@ module B
end

@testset "backtrace" begin
bt = try B.D.g()
bt = try
B.D.g()
catch
catch_backtrace()
end
Expand Down Expand Up @@ -777,15 +778,17 @@ if Sys.isapple() || (Sys.islinux() && Sys.ARCH === :x86_64)
pair_repeater_b() = pair_repeater_a()

@testset "repeated stack frames" begin
let bt = try single_repeater()
let bt = try
single_repeater()
catch
catch_backtrace()
end
bt_str = sprint(Base.show_backtrace, bt)
@test occursin(r"repeats \d+ times", bt_str)
end

let bt = try pair_repeater_a()
let bt = try
pair_repeater_a()
catch
catch_backtrace()
end
Expand Down

0 comments on commit 8f0b17b

Please sign in to comment.