Skip to content

Commit

Permalink
Merge pull request #16363 from KristofferC/kc/tests
Browse files Browse the repository at this point in the history
add tests for closest candidate for type constructors
  • Loading branch information
tkelman committed May 15, 2016
2 parents e72bda1 + 3375ca4 commit 6056e10
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/replutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ for f in [getindex, setindex!]
test_have_color(buf, "", "")
end

type PR16155
a::Int64
b
end

Base.show_method_candidates(buf, MethodError(PR16155,(1.0, 2.0, Int64(3))))
test_have_color(buf, "\e[0m\nClosest candidates are:\n PR16155(::Any, ::Any)\n PR16155(\e[1m\e[31m::Int64\e[0m, ::Any)\n PR16155{T}(::Any)\e[0m",
"\nClosest candidates are:\n PR16155(::Any, ::Any)\n PR16155(!Matched::Int64, ::Any)\n PR16155{T}(::Any)")

Base.show_method_candidates(buf, MethodError(PR16155,(Int64(3), 2.0, Int64(3))))
test_have_color(buf, "\e[0m\nClosest candidates are:\n PR16155(::Int64, ::Any)\n PR16155(::Any, ::Any)\n PR16155{T}(::Any)\e[0m",
"\nClosest candidates are:\n PR16155(::Int64, ::Any)\n PR16155(::Any, ::Any)\n PR16155{T}(::Any)")

macro except_str(expr, err_type)
return quote
let err = nothing
Expand Down

0 comments on commit 6056e10

Please sign in to comment.