File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
test/interval_tests/supposition Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ using Test
2+ using IntervalArithmetic
3+ using Supposition, Supposition. Data
4+
5+ @testset " Rational tests" begin
6+ # Define number generators
7+ # intgen = Data.Integers(typemin(Int)+1,typemax(Int)) # Don't allow den==typemin(Int) to avoid overflow
8+ intgen = Data. Integers (typemin (Int8)+ Int8 (1 ),typemax (Int8)) # Don't allow den==typemin(Int8) to avoid overflow
9+ rationalgen = @composed function generate_rational (num= intgen, den= intgen)
10+ assume! (! (iszero (num) && iszero (den)))
11+ return num // den
12+ end
13+
14+ # Check properties
15+ @check function degenerate_interval (r= rationalgen)
16+ x = interval (r)
17+ y = interval (r, r)
18+ assume! (! any (decoration .((x,y)) .== ill)) # Exclude ill-formed intervals
19+ isequal_interval (x, y)
20+ end
21+ end
You can’t perform that action at this time.
0 commit comments