hedgehog-1.5: Release with confidence.

Safe Haskell | None
Language | Haskell2010

Hedgehog.Internal.Runner

Contents

- Running Individual Properties
- Running Groups of Properties
- Internal

Synopsis

- check :: MonadIO m => Property -> m Bool
- recheck :: MonadIO m => Size -> Seed -> Property -> m ()
- recheckAt :: MonadIO m => Seed -> Skip -> Property -> m ()
- data RunnerConfig = RunnerConfig {
  - runnerWorkers :: !(Maybe WorkerCount)
  - runnerColor :: !(Maybe UseColor)
  - runnerSeed :: !(Maybe Seed)
  - runnerVerbosity :: !(Maybe Verbosity)
  }
- checkParallel :: MonadIO m => Group -> m Bool
- checkSequential :: MonadIO m => Group -> m Bool
- checkGroup :: MonadIO m => RunnerConfig -> Group -> m Bool
- checkReport :: (MonadIO m, MonadCatch m) => PropertyConfig -> Size -> Seed -> PropertyT m () -> (Report Progress -> m ()) -> m (Report Result)
- checkRegion :: MonadIO m => Region -> UseColor -> Maybe PropertyName -> Size -> Seed -> Property -> m (Report Result)
- checkNamed :: MonadIO m => Region -> UseColor -> Maybe PropertyName -> Maybe Seed -> Property -> m (Report Result)

# Running Individual Properties

check :: MonadIO m => Property -> m Bool Source #

Check a property.

recheck :: MonadIO m => Size -> Seed -> Property -> m () Source #

Check a property using a specific size and seed.

recheckAt :: MonadIO m => Seed -> Skip -> Property -> m () Source #

# Running Groups of Properties

data RunnerConfig Source #

Configuration for a property test run.

Constructors

RunnerConfig |

Fields

- runnerWorkers :: !(Maybe WorkerCount)

  The number of property tests to run concurrently. `Nothing` means use one worker per processor.

- runnerColor :: !(Maybe UseColor)

  Whether to use colored output or not. `Nothing` means detect from the environment.

- runnerSeed :: !(Maybe Seed)

  The seed to use. `Nothing` means detect from the environment.

- runnerVerbosity :: !(Maybe Verbosity)

  How verbose to be in the runner output. `Nothing` means detect from the environment.

#### Instances

Instances details

Show RunnerConfig Source # |
Instance details Defined in Hedgehog.Internal.Runner Methods showsPrec :: Int -> RunnerConfig -> ShowS Source # show :: RunnerConfig -> String Source # showList :: [RunnerConfig] -> ShowS Source #
Eq RunnerConfig Source # |
Instance details Defined in Hedgehog.Internal.Runner Methods (==) :: RunnerConfig -> RunnerConfig -> Bool Source # (/=) :: RunnerConfig -> RunnerConfig -> Bool Source #
Ord RunnerConfig Source # |

Instance details

Defined in Hedgehog.Internal.Runner

Methods

compare :: RunnerConfig -> RunnerConfig -> Ordering Source #

(<) :: RunnerConfig -> RunnerConfig -> Bool Source #

(<=) :: RunnerConfig -> RunnerConfig -> Bool Source #

(>) :: RunnerConfig -> RunnerConfig -> Bool Source #

(>=) :: RunnerConfig -> RunnerConfig -> Bool Source #

max :: RunnerConfig -> RunnerConfig -> RunnerConfig Source #

min :: RunnerConfig -> RunnerConfig -> RunnerConfig Source #

Lift RunnerConfig Source # |
Instance details Defined in Hedgehog.Internal.Runner Methods lift :: Quote m => RunnerConfig -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => RunnerConfig -> Code m RunnerConfig Source #

checkParallel :: MonadIO m => Group -> m Bool Source #

Check a group of properties in parallel.

Warning: although this check function runs tests faster than `checkSequential`, it should be noted that it may cause problems with properties that are not self-contained. For example, if you have a group of tests which all use the same database table, you may find that they interfere with each other when being run in parallel.

Using Template Haskell for property discovery:

    tests :: IO Bool
    tests =
      checkParallel $$(discover)

With manually specified properties:

    tests :: IO Bool
    tests =
      checkParallel $ Group "Test.Example" [
          ("prop_reverse", prop_reverse)
        ]

checkSequential :: MonadIO m => Group -> m Bool Source #

Check a group of properties sequentially.

Using Template Haskell for property discovery:

    tests :: IO Bool
    tests =
      checkSequential $$(discover)

With manually specified properties:

    tests :: IO Bool
    tests =
      checkSequential $ Group "Test.Example" [
          ("prop_reverse", prop_reverse)
        ]

checkGroup :: MonadIO m => RunnerConfig -> Group -> m Bool Source #

Check a group of properties using the specified runner config.

# Internal

checkReport :: (MonadIO m, MonadCatch m) => PropertyConfig -> Size -> Seed -> PropertyT m () -> (Report Progress -> m ()) -> m (Report Result) Source #

checkRegion :: MonadIO m => Region -> UseColor -> Maybe PropertyName -> Size -> Seed -> Property -> m (Report Result) Source #

checkNamed :: MonadIO m => Region -> UseColor -> Maybe PropertyName -> Maybe Seed -> Property -> m (Report Result) Source #