Skip to content

Commit

Permalink
Fix test for colorant_string_with_eltype with abbreviable UnionAll (
Browse files Browse the repository at this point in the history
  • Loading branch information
kimikage authored Apr 3, 2021
1 parent fd6beb5 commit 8fc7034
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ end
end
@test ColorTypes.colorant_string_with_eltype(HSV{AbstractFloat}) == "HSV{AbstractFloat}"
@test ColorTypes.colorant_string_with_eltype(TransparentColor) == "TransparentColor"
@test ColorTypes.colorant_string_with_eltype(TransparentColor{RGB{Float32},Float32}) ==
"TransparentColor{RGB{Float32},$(SP)Float32,$(SP)N} where N"
if occursin("where", sprint(show, Array{Float32, N} where N)) # cf. JuliaLang/julia PR #39395
@test ColorTypes.colorant_string_with_eltype(TransparentColor{RGB{Float32},Float32}) ==
"TransparentColor{RGB{Float32},$(SP)Float32,$(SP)N} where N"
else
@test ColorTypes.colorant_string_with_eltype(TransparentColor{RGB{Float32},Float32}) ==
"TransparentColor{RGB{Float32},$(SP)Float32}"
end
@test ColorTypes.colorant_string_with_eltype(TransparentColor{RGB{Float32},Float32,4}) ==
"TransparentColor{RGB{Float32},$(SP)Float32,$(SP)4}"
@test_throws MethodError ColorTypes.colorant_string_with_eltype(Float32)
Expand Down

0 comments on commit 8fc7034

Please sign in to comment.