From 781397b0d73d97c651b4b4496d5c300835861056 Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Mon, 25 Sep 2023 20:09:23 +0100 Subject: [PATCH] Test IntervalSet: {0} V complement {0} --- test/TestIntervalSet.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/TestIntervalSet.hs b/test/TestIntervalSet.hs index c4fb131..d71c441 100644 --- a/test/TestIntervalSet.hs +++ b/test/TestIntervalSet.hs @@ -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 --------------------------------------------------------------------}