Skip to content

Commit 2cab8c0

Browse files
committed
Added misc tests referenced in JuliaLang#19998
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#12721 For JuliaLang#11803 it was decidided that no tests are needed. Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved yet but needs new tests triggering it.
1 parent ff22bd9 commit 2cab8c0

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

test/core.jl

+6-5
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ g11840{T<:Tuple}(sig::Type{T}) = 3
7878

7979
g11840b(::DataType) = 1
8080
g11840b(::Type) = 2
81-
# FIXME: how to compute that the guard entry is still required,
82-
# even though Type{Vector} ∩ DataType = Bottom and this method would set cache_with_orig = true
83-
#g11840b{T<:Tuple}(sig::Type{T}) = 3
81+
# FIXME (needs a test): how to compute that the guard entry is still required,
82+
# even though Type{Vector} ∩ DataType = Bottom and this method would set
83+
# cache_with_orig = true
84+
g11840b{T<:Tuple}(sig::Type{T}) = 3
8485
@test g11840b(Vector) == 2
8586
@test g11840b(Vector.body) == 1
8687
@test g11840b(Vector) == 2
8788
@test g11840b(Vector.body) == 1
88-
#@test g11840b(Tuple) == 3
89-
#@test g11840b(TT11840) == 3
89+
@test g11840b(Tuple) == 3
90+
@test g11840b(TT11840) == 3
9091

9192
h11840(::DataType) = '1'
9293
h11840(::Type) = '2'

test/subtype.jl

+22
Original file line numberDiff line numberDiff line change
@@ -827,5 +827,27 @@ test_intersection()
827827
test_properties()
828828
test_intersection_properties()
829829

830+
830831
# issue #20121
831832
@test NTuple{170,Matrix{Int}} <: (Tuple{Vararg{Union{Array{T,1},Array{T,2},Array{T,3}}}} where T)
833+
834+
# Issue #12580
835+
abstract AbstractMyType12580{T}
836+
immutable MyType12580{T}<:AbstractMyType12580{T} end
837+
tpara{A<:AbstractMyType12580}(::Type{A}) = tpara(supertype(A))
838+
tpara{I}(::Type{AbstractMyType12580{I}}) = I
839+
@test tpara(MyType12580{true})
840+
841+
# Issue #18348
842+
f18348{T<:Any}(::Type{T}, x) = 1
843+
f18348{T<:Any}(::Type{T}, x::T) = 2
844+
@test length(methods(f18348, Tuple{Type{Any},Any})) == 1
845+
846+
# Issue #13165
847+
@test Symmetric{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
848+
@test Hermitian{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
849+
@test Hermitian{Complex{Float64},Matrix{Complex{Float64}}} <: LinAlg.RealHermSymComplexHerm
850+
851+
# Issue #12721
852+
f12721{T<:Type{Int}}(::T) = true
853+
@test_throws MethodError f12721(Float64)

0 commit comments

Comments
 (0)