Skip to content

Commit 31cefa4

Browse files
committed
Add tests of type stability using @inferred
1 parent 5436e9a commit 31cefa4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/interval_tests/consistency.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,4 +388,20 @@ setprecision(Interval, Float64)
388388

389389
end
390390

391+
@testset "Type stability" begin
392+
for T in (Float32, Float64, BigFloat)
393+
394+
x = Interval{T}(3, 4)
395+
y = Interval{T}(5, 6)
396+
397+
for op in (+, -, *, /, atan)
398+
@inferred op(a, b)
399+
end
400+
401+
for op in (sin, cos, exp, log, tan, abs)
402+
@inferred op(a)
403+
end
404+
end
405+
end
406+
391407
end

0 commit comments

Comments
 (0)