我正在将Hedgehog与tasty discover一起使用,并编写了一个简单的类来实现二维坐标/向量。然后我编写了以下测试。唯一的问题是,它似乎只运行了一个测试,运行速度非常快,这让我相信这里有问题。
如何让它运行10000次测试?
module Spec where
import Test.Tasty
import Hedgehog
import Hedgehog.Checkers
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Lib
make2D :: a -> a -> Point2D a
make2D x y = Point2D { _x = x, _y = y }
point2DGen :: (Gen a) -> Gen (Point2D a)
point2DGen g = make2D <$> g <*> g
small2DGen :: Gen (Point2D Int)
small2DGen = point2DGen . Gen.integral $ Range.linearFrom (0 :: Int) (0-10) 10
hprop_SquareMonoid :: Property
hprop_SquareMonoid = withTests 1000000000 . property . monoid $ Square <$> small2DGen