module Test.Hspec.Core.QuickCheck (
modifyArgs
, modifyMaxSuccess
, modifyMaxDiscardRatio
, modifyMaxSize
, modifyMaxShrinks
) where
import Test.QuickCheck
import Test.Hspec.Core.Spec
modifyMaxSuccess :: (Int -> Int) -> SpecWith a -> SpecWith a
modifyMaxSuccess = modifyArgs . modify
where
modify :: (Int -> Int) -> Args -> Args
modify f args = args {maxSuccess = f (maxSuccess args)}
modifyMaxDiscardRatio :: (Int -> Int) -> SpecWith a -> SpecWith a
modifyMaxDiscardRatio = modifyArgs . modify
where
modify :: (Int -> Int) -> Args -> Args
modify f args = args {maxDiscardRatio = f (maxDiscardRatio args)}
modifyMaxSize :: (Int -> Int) -> SpecWith a -> SpecWith a
modifyMaxSize = modifyArgs . modify
where
modify :: (Int -> Int) -> Args -> Args
modify f args = args {maxSize = f (maxSize args)}
modifyMaxShrinks :: (Int -> Int) -> SpecWith a -> SpecWith a
modifyMaxShrinks = modifyArgs . modify
where
modify :: (Int -> Int) -> Args -> Args
modify f args = args {maxShrinks = f (maxShrinks args)}
modifyArgs :: (Args -> Args) -> SpecWith a -> SpecWith a
modifyArgs = modifyParams . modify
where
modify :: (Args -> Args) -> Params -> Params
modify f p = p {paramsQuickCheckArgs = f (paramsQuickCheckArgs p)}