blob: 430d215fdeab211fe5360d1488dccea31dbc8fab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
module Distance
( distanceTests
)
where
import Hedgehog (Property)
import qualified Hedgehog as Hog
import qualified Hedgehog.Gen as Hog
import qualified Hedgehog.Range as Hog
import Verismith.Verilog.Distance
import Test.Tasty
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)
Hog.assert $ udistance x y <= distance x y
distanceTests :: TestTree
distanceTests = testProperty "Unordered distance <= distance" distanceLess
|