Skip to content

Commit 153d749

Browse files
committed
Improve testing
1 parent fea1b34 commit 153d749

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/interval_tests/numeric.jl

+8-7
Original file line numberDiff line numberDiff line change
@@ -435,21 +435,22 @@ end
435435
@test nthroot(Interval{BigFloat}(-81, -16), 1) == Interval{BigFloat}(-81, -16)
436436
end
437437

438-
# approximation used in this testing (not to rely on ≈ for intervals)
439-
(x::Interval, y::Interval) = x.lo y.lo && x.hi y.hi
438+
# approximation used for testing (not to rely on ≈ for intervals)
439+
# ⪆(x, y) = (x ≈ y) && (y ⊆ x)
440+
(x::Interval, y::Interval) = x.lo y.lo && x.hi y.hi && y x
440441

441442
@testset "`mod`" begin
442443
r = 0.0625
443444
x = r..(1+r)
444445
@test mod(x, 1) == mod(x, 1.0) == 0..1
445-
@test mod(x, 2) == mod(x, 2.0) x
446-
@test mod(x, 2.5) x
446+
@test mod(x, 2) == mod(x, 2.0) x
447+
@test mod(x, 2.5) x
447448
@test mod(x, 0.5) == 0..0.5
448449

449450
x = (-1+r) .. -r
450-
@test mod(x, 1) == mod(x, 1.0) 1+x
451-
@test mod(x, 2) == mod(x, 2.0) 2+x
452-
@test mod(x, 2.5) 2.5+x
451+
@test mod(x, 1) == mod(x, 1.0) 1+x
452+
@test mod(x, 2) == mod(x, 2.0) 2+x
453+
@test mod(x, 2.5) 2.5+x
453454
@test mod(x, 0.5) == 0..0.5
454455

455456
x = -r .. 1-r

0 commit comments

Comments
 (0)