hedgehog-1.5: Release with confidence.

Safe Haskell | None
Language | Haskell2010

Hedgehog.Internal.Config

Synopsis

- data UseColor
  - = DisableColor
  - | EnableColor
- resolveColor :: MonadIO m => Maybe UseColor -> m UseColor
- data Seed = Seed {
  - seedValue :: !Word64
  - seedGamma :: !Word64
  }
- resolveSeed :: MonadIO m => Maybe Seed -> m Seed
- data Verbosity
  - = Quiet
  - | Normal
- resolveVerbosity :: MonadIO m => Maybe Verbosity -> m Verbosity
- newtype WorkerCount = WorkerCount Int
- resolveWorkers :: MonadIO m => Maybe WorkerCount -> m WorkerCount
- data Skip
  - = SkipNothing
  - | SkipToTest TestCount DiscardCount
  - | SkipToShrink TestCount DiscardCount ShrinkPath
- resolveSkip :: MonadIO m => Maybe Skip -> m Skip
- detectMark :: MonadIO m => m Bool
- detectColor :: MonadIO m => m UseColor
- detectSeed :: MonadIO m => m Seed
- detectVerbosity :: MonadIO m => m Verbosity
- detectWorkers :: MonadIO m => m WorkerCount
- detectSkip :: MonadIO m => m Skip

# Documentation

data UseColor Source #

Whether to render output using ANSI colors or not.

Constructors

DisableColor | Disable ANSI colors in report output.
EnableColor | Enable ANSI colors in report output.

#### Instances

Instances details

Show UseColor Source # |
Instance details Defined in Hedgehog.Internal.Config Methods showsPrec :: Int -> UseColor -> ShowS Source # show :: UseColor -> String Source # showList :: [UseColor] -> ShowS Source #
Eq UseColor Source # |
Instance details Defined in Hedgehog.Internal.Config Methods (==) :: UseColor -> UseColor -> Bool Source # (/=) :: UseColor -> UseColor -> Bool Source #
Ord UseColor Source # |
Instance details Defined in Hedgehog.Internal.Config Methods compare :: UseColor -> UseColor -> Ordering Source # (<) :: UseColor -> UseColor -> Bool Source # (<=) :: UseColor -> UseColor -> Bool Source # (>) :: UseColor -> UseColor -> Bool Source # (>=) :: UseColor -> UseColor -> Bool Source # max :: UseColor -> UseColor -> UseColor Source # min :: UseColor -> UseColor -> UseColor Source #
Lift UseColor Source # |
Instance details Defined in Hedgehog.Internal.Config Methods lift :: Quote m => UseColor -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => UseColor -> Code m UseColor Source #

resolveColor :: MonadIO m => Maybe UseColor -> m UseColor Source #

data Seed Source #

A splittable random number generator.

Constructors

Seed |

Fields

- seedValue :: !Word64
- seedGamma :: !Word64

  must be an odd number

#### Instances

Instances details

Read Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods readsPrec :: Int -> ReadS Seed Source # readList :: ReadS [Seed] Source # readPrec :: ReadPrec Seed Source # readListPrec :: ReadPrec [Seed] Source #
Show Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods showsPrec :: Int -> Seed -> ShowS Source # show :: Seed -> String Source # showList :: [Seed] -> ShowS Source #
Eq Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods (==) :: Seed -> Seed -> Bool Source # (/=) :: Seed -> Seed -> Bool Source #
Ord Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods compare :: Seed -> Seed -> Ordering Source # (<) :: Seed -> Seed -> Bool Source # (<=) :: Seed -> Seed -> Bool Source # (>) :: Seed -> Seed -> Bool Source # (>=) :: Seed -> Seed -> Bool Source # max :: Seed -> Seed -> Seed Source # min :: Seed -> Seed -> Seed Source #
RandomGen Seed Source # |

Instance details

Defined in Hedgehog.Internal.Seed

Methods

next :: Seed -> (Int, Seed) Source #

genWord8 :: Seed -> (Word8, Seed) Source #

genWord16 :: Seed -> (Word16, Seed) Source #

genWord32 :: Seed -> (Word32, Seed) Source #

genWord64 :: Seed -> (Word64, Seed) Source #

genWord32R :: Word32 -> Seed -> (Word32, Seed) Source #

genWord64R :: Word64 -> Seed -> (Word64, Seed) Source #

genShortByteString :: Int -> Seed -> (ShortByteString, Seed) Source #

genRange :: Seed -> (Int, Int) Source #

split :: Seed -> (Seed, Seed) Source #

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

resolveSeed :: MonadIO m => Maybe Seed -> m Seed Source #

data Verbosity Source #

How verbose should the report output be.

Constructors

Quiet | Only display the summary of the test run.
Normal | Display each property as it is running, as well as the summary.

#### Instances

Instances details

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

Instance details

Defined in Hedgehog.Internal.Config

Methods

compare :: Verbosity -> Verbosity -> Ordering Source #

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

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

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

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

max :: Verbosity -> Verbosity -> Verbosity Source #

min :: Verbosity -> Verbosity -> Verbosity Source #

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

resolveVerbosity :: MonadIO m => Maybe Verbosity -> m Verbosity Source #

newtype WorkerCount Source #

The number of workers to use when running properties in parallel.

Constructors

WorkerCount Int |

#### Instances

Instances details

Enum WorkerCount Source # |

Instance details

Defined in Hedgehog.Internal.Config

Methods

succ :: WorkerCount -> WorkerCount Source #

pred :: WorkerCount -> WorkerCount Source #

toEnum :: Int -> WorkerCount Source #

fromEnum :: WorkerCount -> Int Source #

enumFrom :: WorkerCount -> [WorkerCount] Source #

enumFromThen :: WorkerCount -> WorkerCount -> [WorkerCount] Source #

enumFromTo :: WorkerCount -> WorkerCount -> [WorkerCount] Source #

enumFromThenTo :: WorkerCount -> WorkerCount -> WorkerCount -> [WorkerCount] Source #

Num WorkerCount Source # |

Instance details

Defined in Hedgehog.Internal.Config

Methods

(+) :: WorkerCount -> WorkerCount -> WorkerCount Source #

(-) :: WorkerCount -> WorkerCount -> WorkerCount Source #

(*) :: WorkerCount -> WorkerCount -> WorkerCount Source #

negate :: WorkerCount -> WorkerCount Source #

abs :: WorkerCount -> WorkerCount Source #

signum :: WorkerCount -> WorkerCount Source #

fromInteger :: Integer -> WorkerCount Source #

Integral WorkerCount Source # |

Instance details

Defined in Hedgehog.Internal.Config

Methods

quot :: WorkerCount -> WorkerCount -> WorkerCount Source #

rem :: WorkerCount -> WorkerCount -> WorkerCount Source #

div :: WorkerCount -> WorkerCount -> WorkerCount Source #

mod :: WorkerCount -> WorkerCount -> WorkerCount Source #

quotRem :: WorkerCount -> WorkerCount -> (WorkerCount, WorkerCount) Source #

divMod :: WorkerCount -> WorkerCount -> (WorkerCount, WorkerCount) Source #

toInteger :: WorkerCount -> Integer Source #

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

Instance details

Defined in Hedgehog.Internal.Config

Methods

compare :: WorkerCount -> WorkerCount -> Ordering Source #

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

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

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

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

max :: WorkerCount -> WorkerCount -> WorkerCount Source #

min :: WorkerCount -> WorkerCount -> WorkerCount Source #

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

resolveWorkers :: MonadIO m => Maybe WorkerCount -> m WorkerCount Source #

data Skip Source #

Where to start running a property's tests.

Constructors

SkipNothing | Don't skip anything.
SkipToTest TestCount DiscardCount | Skip to a specific test number. If it fails, shrink as normal. If it passes, move on to the next test. Coverage checks are disabled. We also need to count discards, since failing "after 7 tests" points at a different generated value than failing "after 7 tests and 5 discards".
SkipToShrink TestCount DiscardCount ShrinkPath | Skip to a specific test number and shrink state. If it fails, stop without shrinking further. If it passes, the property will pass without running any more tests. Due to implementation details, all intermediate shrink states - those on the direct path from the original test input to the target state - will be tested too, and their results discarded.

#### Instances

Instances details

IsString Skip Source #

We use this instance to support usage like

      withSkip "3:aB"

It throws an error if the input is not a valid compressed `Skip`.

Instance details Defined in Hedgehog.Internal.Property Methods fromString :: String -> Skip Source #
Show Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> Skip -> ShowS Source # show :: Skip -> String Source # showList :: [Skip] -> ShowS Source #
Eq Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: Skip -> Skip -> Bool Source # (/=) :: Skip -> Skip -> Bool Source #
Ord Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods compare :: Skip -> Skip -> Ordering Source # (<) :: Skip -> Skip -> Bool Source # (<=) :: Skip -> Skip -> Bool Source # (>) :: Skip -> Skip -> Bool Source # (>=) :: Skip -> Skip -> Bool Source # max :: Skip -> Skip -> Skip Source # min :: Skip -> Skip -> Skip Source #
Lift Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => Skip -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Skip -> Code m Skip Source #

resolveSkip :: MonadIO m => Maybe Skip -> m Skip Source #

detectMark :: MonadIO m => m Bool Source #

detectColor :: MonadIO m => m UseColor Source #

detectSeed :: MonadIO m => m Seed Source #

detectVerbosity :: MonadIO m => m Verbosity Source #

detectWorkers :: MonadIO m => m WorkerCount Source #

detectSkip :: MonadIO m => m Skip Source #