Skip to content

Commit 42ca9d1

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 8313964 commit 42ca9d1

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

test/core.jl

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

7373
g11840b(::DataType) = 1
7474
g11840b(::Type) = 2
75-
# FIXME: how to compute that the guard entry is still required,
76-
# even though Type{Vector} ∩ DataType = Bottom and this method would set cache_with_orig = true
77-
#g11840b{T<:Tuple}(sig::Type{T}) = 3
75+
# FIXME (needs a test): how to compute that the guard entry is still required,
76+
# even though Type{Vector} ∩ DataType = Bottom and this method would set
77+
# cache_with_orig = true
78+
g11840b{T<:Tuple}(sig::Type{T}) = 3
7879
@test g11840b(Vector) == 2
7980
@test g11840b(Vector.body) == 1
8081
@test g11840b(Vector) == 2
8182
@test g11840b(Vector.body) == 1
82-
#@test g11840b(Tuple) == 3
83-
#@test g11840b(TT11840) == 3
83+
@test g11840b(Tuple) == 3
84+
@test g11840b(TT11840) == 3
8485

8586
h11840(::DataType) = '1'
8687
h11840(::Type) = '2'

test/subtype.jl

+21
Original file line numberDiff line numberDiff line change
@@ -826,3 +826,24 @@ test_old()
826826
test_intersection()
827827
test_properties()
828828
test_intersection_properties()
829+
830+
# Issue #12580
831+
abstract AbstractMyType12580{T}
832+
immutable MyType12580{T}<:AbstractMyType12580{T} end
833+
tpara{A<:AbstractMyType12580}(::Type{A}) = tpara(supertype(A))
834+
tpara{I}(::Type{AbstractMyType12580{I}}) = I
835+
@test tpara(MyType12580{true})
836+
837+
# Issue #18348
838+
f18348{T<:Any}(::Type{T}, x) = 1
839+
f18348{T<:Any}(::Type{T}, x::T) = 2
840+
@test length(methods(f18348, Tuple{Type{Any},Any})) == 1
841+
842+
# Issue #13165
843+
@test Symmetric{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
844+
@test Hermitian{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
845+
@test Hermitian{Complex{Float64},Matrix{Complex{Float64}}} <: LinAlg.RealHermSymComplexHerm
846+
847+
# Issue #12721
848+
f12721{T<:Type{Int}}(::T) = true
849+
@test_throws MethodError f12721(Float64)

0 commit comments

Comments
 (0)