Skip to content

Commit

Permalink
add tests for closest candidate for type constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed May 14, 2016
1 parent 91c0db7 commit 3375ca4
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 3375ca4

Please sign in to comment.