@@ -116,7 +116,7 @@ ColorTypes.comp2(c::RGBA32) = alpha(c)
116116 @test_throws MethodError cf ÷ cf
117117 @test cf + 0.1 === 0.1 + cf === Gray (Float64 (0.1f0 ) + 0.1 )
118118 @test cf64 - 0.1f0 === - (0.1f0 - cf64) === Gray ( 0.2 - Float64 (0.1f0 ))
119- @test_throws MethodError abs2 (ccmp)
119+ @test abs2 (ccmp) === abs2 (gray ( ccmp) )
120120 @test norm (cf) == norm (cf, 2 ) == norm (gray (cf))
121121 @test norm (cf, 1 ) == norm (gray (cf), 1 )
122122 @test norm (cf, Inf ) == norm (gray (cf), Inf )
@@ -384,7 +384,9 @@ ColorTypes.comp2(c::RGBA32) = alpha(c)
384384 @test isinf (RGB (1 , Inf , 0.5 ))
385385 @test ! isnan (RGB (1 , Inf , 0.5 ))
386386 @test abs (RGB (0.1 ,0.2 ,0.3 )) == RGB (0.1 ,0.2 ,0.3 )
387- @test_throws MethodError abs2 (RGB (0.1 ,0.2 ,0.3 ))
387+ cv = RGB (0.1 ,0.2 ,0.3 )
388+ @test abs2 (cv) == cv ⋅ cv
389+ @test abs2 (cv) ≈ norm (cv)^ 2
388390 @test_throws MethodError sum (abs2, RGB (0.1 ,0.2 ,0.3 ))
389391 @test norm (RGB (0.1 ,0.2 ,0.3 )) ≈ sqrt (0.14 )/ sqrt (3 )
390392
@@ -774,6 +776,8 @@ ColorTypes.comp2(c::RGBA32) = alpha(c)
774776 @test varmult (⊙ , cs, dims= 2 ) ≈ 2 * [v1, v1, v1]
775777 v2 = RGB (0.1 ^ 2 , 0.01 ^ 2 , 0.03 ^ 2 )
776778 @test varmult (⊙ , cs, dims= 1 ) ≈ [v2 v2]
779+
780+ @test var (cs) == varmult (⋅ , cs)
777781 end
778782
779783 @testset " copy" begin
0 commit comments