Skip to content

Commit 72b211e

Browse files
committed
Add Rational tests for 1//0 and -1//0 edge cases
1 parent cecb913 commit 72b211e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/interval_tests/construction.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
@test sup(IntervalArithmetic._unsafe_bareinterval(Float64, Inf, Inf)) == Inf
1010
@test isempty_interval(bareinterval(Inf, Inf))
1111
@test isnai(interval(Inf, Inf))
12+
@test isnai(interval(1//0, 1//0))
13+
@test isnai(interval(-1//0, -1//0))
14+
@test isnai(interval(1//0, -1//0))
1215
end
1316

1417
@testset "Basics" begin
@@ -70,6 +73,9 @@ end
7073
@test isnai(interval(1, NaN))
7174
@test isnai(interval(NaN))
7275

76+
@test isnai(interval(1//0))
77+
@test isnai(interval(-1//0))
78+
7379
# check no issue with `Integer` modular arithmetic
7480
@test bounds(interval(typemin(Int64), typemax(Int64))) == (float(typemin(Int64)), float(typemax(Int64)))
7581

0 commit comments

Comments
 (0)