Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrehren authored Feb 16, 2017
1 parent 2d17dd9 commit 26e4e5f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/subtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -915,3 +915,27 @@ ftwoparams(::TwoParams{<:Real,<:Real}) = 3
# supertype operator
@test !(Int >: Integer)
@test Integer >: Int

# #2552
typealias DiagDict{T} Dict{T,T}
f2552(::Dict) = 1
f2552(::DiagDict) = 2
@test f2552(Dict(1 => "a")) == 1
@test f2552(Dict(1 => 1)) == 2

# #8625
typealias CV8625{T<:Real} Vector{Complex{T}}
@test isa([2.0+3.0im],CV8625)

# #8915
type D8915{T <: Union{Float32,Float64}}
D8915(a) = 1
D8915(a::Int) = 2
end
@test D8915{Float64}(1) = 2

# #11407
f11407{K,V}(::Dict{K,V},::Dict{Any,V}) = 1
f11407{K,V}(::Dict{K,V},::Dict{K,Any}) = 2
d = Dict{Any,Any}()
@test_throws MethodError f11407(d,d)

0 comments on commit 26e4e5f

Please sign in to comment.