Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Supposition = "5a0628fe-1738-4658-9b6d-0b7605a9755b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
21 changes: 21 additions & 0 deletions test/interval_tests/supposition/numeric.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Test
using IntervalArithmetic
using Supposition, Supposition.Data

@testset "Rational tests" begin
# Define number generators
#intgen = Data.Integers(typemin(Int)+1,typemax(Int)) # Don't allow den==typemin(Int) to avoid overflow
intgen = Data.Integers(typemin(Int8)+Int8(1),typemax(Int8)) # Don't allow den==typemin(Int8) to avoid overflow
rationalgen = @composed function generate_rational(num=intgen, den=intgen)
assume!(!(iszero(num) && iszero(den)))
return num // den
end

# Check properties
@check function degenerate_interval(r=rationalgen)
x = interval(r)
y = interval(r, r)
assume!(!any(decoration.((x,y)) .== ill)) # Exclude ill-formed intervals
isequal_interval(x, y)
end
end
9 changes: 8 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ import IntervalSets as IS
include("generate_ITF1788.jl")

# interval tests
for f ∈ readdir("interval_tests"; join = true)
for f ∈ filter(isfile, readdir("interval_tests"; join = true))
@testset "$f" begin
include(f)
end
end

# interval tests using Supposition
for f ∈ filter(isfile, readdir("interval_tests/supposition"; join = true))
@testset "$f" begin
include(f)
end
Expand Down