Skip to content

Commit 310d109

Browse files
committed
Test that the larger predicate is monotone.
1 parent b77df88 commit 310d109

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/Data/IntervalSet/Test.hs

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Data.IntervalSet.Test
33
( tests
44
) where
55

6+
import Control.Monad (when)
67
import Data.Foldable (foldl')
78
import Data.Functor.I
89
import Data.Functor.Interval
@@ -23,6 +24,13 @@ tests = testGroup "IntervalSet"
2324
s <- insert i <$> forAll gs
2425
insert i s === s
2526
]
27+
, testGroup "larger"
28+
[ testProperty "monotone" . property $ do
29+
i1 <- forAll gi
30+
i2 <- forAll gi
31+
i3 <- forAll gi
32+
when (larger i1 (Just i2)) $ larger i1 (Just (i2 <> i3)) === True
33+
]
2634
]
2735
where
2836
gp = Gen.int (Range.linear 0 100)

0 commit comments

Comments
 (0)