Skip to content

Commit eac7652

Browse files
committed
Improve tests
1 parent 4a2183f commit eac7652

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

test/interval_tests/consistency.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,21 @@ setprecision(Interval, Float64)
391391
@testset "Type stability" begin
392392
for T in (Float32, Float64, BigFloat)
393393

394-
x = Interval{T}(3, 4)
395-
y = Interval{T}(5, 6)
394+
xs = [3..4, 0..4, 0..0, -4..0, -4..4, -Inf..4, 4..Inf, -Inf..Inf]
396395

397-
for op in (+, -, *, /, atan)
398-
@inferred op(a, b)
399-
end
396+
for x in xs
397+
for y in xs
398+
xx = Interval{T}(x)
399+
yy = Interval{T}(y)
400+
401+
for op in (+, -, *, /, atan)
402+
@inferred op(x, y)
403+
end
404+
end
400405

401-
for op in (sin, cos, exp, log, tan, abs, mid, diam)
402-
@inferred op(a)
406+
for op in (sin, cos, exp, log, tan, abs, mid, diam)
407+
@inferred op(x)
408+
end
403409
end
404410
end
405411
end

0 commit comments

Comments
 (0)