0

我正在使用带有美味发现的 Hedgehog,并编写了一个实现 Square 2D 坐标/向量的简单类。然后我编写了以下测试。唯一的问题是,它似乎只运行一个测试,运行速度非常快,让我相信这里有问题。

如何让它运行测试 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
4

0 回答 0