Skip to content

Commit

Permalink
test: fix TypeCompareError conflict (JuliaLang#49663)
Browse files Browse the repository at this point in the history
We have a slightly over-eager test in error.jl that requires all types
ending in Error to subtype Exception, so this can cause a sporadic
failure without this update.
  • Loading branch information
vtjnash authored May 8, 2023
1 parent 4e782bf commit 1ae70ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,9 @@ bt_str = sprint(Base.show_backtrace, bt)
@test !occursin("g_collapse_pos_kw(x::Float64)", bt_str)

# Test Base.print_with_compare in convert MethodErrors
struct TypeCompareError{A,B} end
let e = try convert(TypeCompareError{Float64,1}, TypeCompareError{Float64,2}()); catch e e end
str = sprint(Base.showerror, e)
struct TypeCompareError{A,B} <: Exception end
let e = @test_throws MethodError convert(TypeCompareError{Float64,1}, TypeCompareError{Float64,2}())
str = sprint(Base.showerror, e.value)
@test occursin("TypeCompareError{Float64,2}", str)
@test occursin("TypeCompareError{Float64,1}", str)
@test !occursin("TypeCompareError{Float64{},2}", str) # No {...} for types without params
Expand Down

0 comments on commit 1ae70ec

Please sign in to comment.