diff options
Diffstat (limited to 'test/Distance.hs')
-rw-r--r-- | test/Distance.hs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/Distance.hs b/test/Distance.hs index 430d215..a59b401 100644 --- a/test/Distance.hs +++ b/test/Distance.hs @@ -3,7 +3,7 @@ module Distance ) where -import Hedgehog (Property) +import Hedgehog (Property, (===)) import qualified Hedgehog as Hog import qualified Hedgehog.Gen as Hog import qualified Hedgehog.Range as Hog @@ -13,9 +13,18 @@ import Test.Tasty.Hedgehog distanceLess :: Property distanceLess = Hog.property $ do - x <- Hog.forAll (Hog.list (Hog.linear 0 10) Hog.alpha) - y <- Hog.forAll (Hog.list (Hog.linear 0 10) Hog.alpha) + x <- Hog.forAll (Hog.list (Hog.linear 0 15) Hog.alpha) + y <- Hog.forAll (Hog.list (Hog.linear 0 15) Hog.alpha) Hog.assert $ udistance x y <= distance x y +distanceEq :: Property +distanceEq = Hog.property $ do + x <- Hog.forAll (Hog.list (Hog.linear 0 15) Hog.alpha) + distance x x === 0 + udistance x x === 0 + distanceTests :: TestTree -distanceTests = testProperty "Unordered distance <= distance" distanceLess +distanceTests = testGroup "Distance tests" + [ testProperty "Unordered distance <= distance" distanceLess + , testProperty "distance x x === 0" distanceEq + ] |