Skip to content

Commit

Permalink
more tests for split of Interval
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed May 28, 2024
1 parent 7928b89 commit bbf90a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/Sets/Interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ for N in [Float64, Float32, Rational{Int}]
@test diameter(x) == diameter(x, Inf) == diameter(x, 2) == N(2)

# split
@test split(x, 4) == [Interval(N(1), N(3 // 2)), Interval(N(3 // 2), N(2)),
Interval(N(2), N(5 // 2)), Interval(N(5 // 2), N(3))]
intervals = [Interval(N(1), N(3 // 2)), Interval(N(3 // 2), N(2)),
Interval(N(2), N(5 // 2)), Interval(N(5 // 2), N(3))]
@test split(x, 4) == split(x, [4]) == intervals
@test_throws AssertionError split(x, 0)
@test_throws AssertionError split(x, [4, 4])

# concrete intersection
A = Interval(N(5), N(7))
Expand Down

0 comments on commit bbf90a1

Please sign in to comment.