JuliaGraphics / ColorTypes.jl

Basic color definitions and traits
Other
77 stars 35 forks source link

Change line ending code of "test/operations.jl" and refactor `rand` tests #221

Closed kimikage closed 3 years ago

kimikage commented 3 years ago

This adds the broken test to identify the problems with rand.

cf. https://github.com/JuliaGraphics/ColorTypes.jl/issues/150#issuecomment-691455695, https://github.com/JuliaGraphics/ColorTypes.jl/issues/150#issuecomment-691459180

julia> rand(AHSV) # transparent color except for RGB and Gray
ERROR: MethodError: no method matching gamutmax(::Type{AHSV{Float64}})

julia> rand(RGB24)
ERROR: TypeError: in Type{...} expression, expected UnionAll, got Type{RGB24}

julia> rand(ARGB32)
ERROR: TypeError: in Type{...} expression, expected UnionAll, got Type{ARGB32}

julia> using Random, FixedPointNumbers

julia> rand(MersenneTwister(), RGB{Float32}) # RNG option
ERROR: ArgumentError: Sampler for this object is not defined

julia> rand(RGB{Q1f6}) # invalid range with (signed) `Fixed`
RGB{Q1f6}(0.23Q1f6,-0.41Q1f6,-0.12Q1f6)
codecov[bot] commented 3 years ago

Codecov Report

Merging #221 (fbf3227) into master (eae0c85) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #221   +/-   ##
=======================================
  Coverage   95.38%   95.38%           
=======================================
  Files           8        8           
  Lines         758      758           
=======================================
  Hits          723      723           
  Misses         35       35           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eae0c85...fbf3227. Read the comment docs.

kimikage commented 3 years ago

I am going to merge this in the next few days, since this does not change the "src", and it is better to fix the line ending code as early as possible.

On the other hand, I don't think #222 needs to be finished in a hurry.