Skip to content

Commit

Permalink
Test IntervalSet: {0} V complement {0}
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Sep 27, 2023
1 parent 6858346 commit 781397b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/TestIntervalSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ case_insert_connected =
IntervalSet.insert (1 <=..< 2 :: Interval Rational) (IntervalSet.fromList [ 0 <=..< 1, 2 <=..< 3 ])
@?= IntervalSet.singleton (0 <=..< 3)

case_insert_zero =
IntervalSet.insert zero (IntervalSet.complement $ IntervalSet.singleton zero) @?= IntervalSet.whole
where
zero :: Interval Rational
zero = 0 <=..<= 0

case_insert_zero_negative =
IntervalSet.insert zero negative @?= nonPositive
where
zero :: Interval Rational
zero = 0 <=..<= 0
negative :: IntervalSet Rational
negative = IntervalSet.singleton $ NegInf <..< 0
nonPositive :: IntervalSet Rational
nonPositive = IntervalSet.singleton $ NegInf <..<= 0

{--------------------------------------------------------------------
delete
--------------------------------------------------------------------}
Expand Down

0 comments on commit 781397b

Please sign in to comment.