From 3fdc8ee326e2339e9d69423857663f9f8ded9ce9 Mon Sep 17 00:00:00 2001 From: miguelraz Date: Wed, 19 Sep 2018 13:55:33 -0500 Subject: [PATCH 1/2] ==(DecoratedInterval,Interavl) == false --- src/decorations/functions.jl | 3 +++ test/decoration_tests/decoration_tests.jl | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/decorations/functions.jl b/src/decorations/functions.jl index 1d41070e1..b33b5fc03 100644 --- a/src/decorations/functions.jl +++ b/src/decorations/functions.jl @@ -33,6 +33,9 @@ end in(x::T, a::DecoratedInterval) where T<:Real = in(x, interval_part(a)) +@inline Base.:(==)(xx::DecoratedInterval, yy::Interval) = false +@inline Base.:(==)(y::Interval, xx::DecoratedInterval) = false + ## scalar functions: mig, mag and friends scalar_functions = ( diff --git a/test/decoration_tests/decoration_tests.jl b/test/decoration_tests/decoration_tests.jl index 81117f41b..0c03bcba9 100644 --- a/test/decoration_tests/decoration_tests.jl +++ b/test/decoration_tests/decoration_tests.jl @@ -34,6 +34,12 @@ let b # @test_throws ArgumentError DecoratedInterval(BigInt(1), 1//10) # @test_throws ArgumentError @decorated(BigInt(1), 1//10) + #Issue 219 + @test ==(DecoratedInterval(2,3),Interval(1,2)) == false + @test ==(Interval(-1,5), DecoratedInterval(4,5)) == false + @test ==(nai(), DecoratedInterval(-1,∞)) == false + @test ==(DecoratedInterval(3,4),nai()) == false + # Tests related to powers of decorated Intervals @test @decorated(2,3) ^ 2 == DecoratedInterval(4, 9) @test @decorated(2,3) ^ -2 == DecoratedInterval(1/9,1/4) From a38d710823f099d67890e87b9b23300cab385476 Mon Sep 17 00:00:00 2001 From: miguelraz Date: Wed, 19 Sep 2018 14:11:22 -0500 Subject: [PATCH 2/2] Hotfix for ==(DecoratedInterval,Interval) --- src/decorations/functions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decorations/functions.jl b/src/decorations/functions.jl index b33b5fc03..e88aed564 100644 --- a/src/decorations/functions.jl +++ b/src/decorations/functions.jl @@ -33,8 +33,8 @@ end in(x::T, a::DecoratedInterval) where T<:Real = in(x, interval_part(a)) -@inline Base.:(==)(xx::DecoratedInterval, yy::Interval) = false -@inline Base.:(==)(y::Interval, xx::DecoratedInterval) = false +==(xx::DecoratedInterval, yy::Interval) = false +==(y::Interval, xx::DecoratedInterval) = false ## scalar functions: mig, mag and friends