Skip to content

Commit d6bf67e

Browse files
committed
Add @test_throws for Interval constructor
1 parent 81cc683 commit d6bf67e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/interval_tests/construction.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import IntervalArithmetic: unsafe_interval
1313
@test interval( (1.0, 2.0) ) interval(Float64, 1.0, 2.0)
1414
@test interval(BigFloat, 1) interval(BigFloat, big(1.0), big(1.0))
1515

16+
# constructing interval with `Interval` fails
17+
@test_throws MethodError Interval(1, 2)
18+
@test_throws MethodError Interval{Float64}(1.0, 2.0)
19+
1620
# Irrational
1721
for irr in (π, ℯ)
1822
@test interval(-irr, irr).hi == (-irr..irr).hi

0 commit comments

Comments
 (0)