sandwich-quickcheck-0.1.0.7: Sandwich integration with QuickCheck
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Sandwich.QuickCheck

Description

Functions for introducing QuickCheck tests into a Sandwich test tree. Modelled after Hspec's version.

Documentation can be found here.

Synopsis

Introducing QuickCheck args

introduceQuickCheck :: (MonadIO m, MonadBaseControl IO m) => SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Same as introduceQuickCheck' but with default args.

introduceQuickCheck' :: (MonadIO m, MonadBaseControl IO m) => Args -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Same as introduceQuickCheck'' but with a default message.

introduceQuickCheck'' :: (MonadIO m, MonadBaseControl IO m) => String -> Args -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Introduce QuickCheck args with configurable message.

Versions that can be configured with built-in command line arguments.

introduceQuickCheckCommandLineOptions :: forall a m context. (MonadIO m, MonadBaseControl IO m, HasLabel context "commandLineOptions" (CommandLineOptions a), MonadReader context m) => SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Same as introduceQuickCheckCommandLineOptions' but with default args.

introduceQuickCheckCommandLineOptions' :: forall a m context. (MonadIO m, MonadBaseControl IO m, HasLabel context "commandLineOptions" (CommandLineOptions a), MonadReader context m) => Args -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Same as introduceQuickCheckCommandLineOptions'' but with a default message.

introduceQuickCheckCommandLineOptions'' :: forall a m context. (MonadIO m, MonadBaseControl IO m, HasLabel context "commandLineOptions" (CommandLineOptions a), MonadReader context m) => String -> Args -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Introduce QuickCheck args with configurable message, overriding those args with any command line options passed.

Prop

prop :: (HasCallStack, HasQuickCheckContext context, MonadIO m, MonadThrow m, Testable prop) => String -> prop -> Free (SpecCommand context m) () Source #

Similar to it. Runs the given prop with QuickCheck using the currently introduced Args. Throws an appropriate exception on failure.

Modifying QuickCheck args

modifyArgs :: (HasQuickCheckContext context, Monad m) => (Args -> Args) -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Modify the Args for the given spec.

modifyMaxSuccess :: (HasQuickCheckContext context, Monad m) => (Int -> Int) -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Modify the maxSuccess for the given spec.

modifyMaxDiscardRatio :: (HasQuickCheckContext context, Monad m) => (Int -> Int) -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Modify the maxDiscardRatio for the given spec.

modifyMaxSize :: (HasQuickCheckContext context, Monad m) => (Int -> Int) -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Modify the maxSize for the given spec.

modifyMaxShrinks :: (HasQuickCheckContext context, Monad m) => (Int -> Int) -> SpecFree (LabelValue "quickCheckContext" QuickCheckContext :> context) m () -> SpecFree context m () Source #

Modify the maxShrinks for the given spec.