tasty-hedgehog-1.4.0.2: Integration for tasty and hedgehog.

Safe Haskell | None
Language | Haskell2010

Test.Tasty.Hedgehog

Contents

- Options you can pass in via tasty

Description

This package lets you test Hedgehog properties with tasty.

Typical usage would look like this:

    testGroup "tasty-hedgehog tests" [
       testPropertyNamed "reverse involutive" "prop_reverse_involutive" prop_reverse_involutive
     , testPropertyNamed "sort idempotent"    "prop_sort_idempotent"    prop_sort_idempotent
     ]

Synopsis

- testProperty :: TestName -> Property -> TestTree
- testPropertyNamed :: TestName -> PropertyName -> Property -> TestTree
- fromGroup :: Group -> TestTree
- newtype HedgehogReplay = HedgehogReplay (Maybe (Skip, Seed))
- newtype HedgehogShowReplay = HedgehogShowReplay Bool
- newtype HedgehogTestLimit = HedgehogTestLimit (Maybe TestLimit)
- newtype HedgehogDiscardLimit = HedgehogDiscardLimit (Maybe DiscardLimit)
- newtype HedgehogShrinkLimit = HedgehogShrinkLimit (Maybe ShrinkLimit)
- newtype HedgehogShrinkRetries = HedgehogShrinkRetries (Maybe ShrinkRetries)

# Documentation

testProperty :: TestName -> Property -> TestTree Source #

Create a `TestTree` from a Hedgehog `Property`.

testPropertyNamed :: TestName -> PropertyName -> Property -> TestTree Source #

`testPropertyNamed` `testName propertyName property` creates a `TestTree` from `property` using `testName` as the displayed description for the property. The `propertyName` is used by Hedgehog when a failure occurs to provide instructions for how to re-run the property and should normally be set to a string representation of the `property` argument.

    testPropertyNamed
     "reverse is involutive"
     "prop_reverse_involutive"
     prop_reverse_involutive

Since: 1.2.0.0

fromGroup :: Group -> TestTree Source #

Create a `TestTree` from a Hedgehog `Group`.

# Options you can pass in via tasty

newtype HedgehogReplay Source #

The replay token to use for replaying a previous test run

Constructors

HedgehogReplay (Maybe (Skip, Seed)) |

#### Instances

Instances details

IsOption HedgehogReplay Source # |
Instance details Defined in Test.Tasty.Hedgehog Methods defaultValue :: HedgehogReplay Source # parseValue :: String -> Maybe HedgehogReplay Source # optionName :: Tagged HedgehogReplay String Source # optionHelp :: Tagged HedgehogReplay String Source # showDefaultValue :: HedgehogReplay -> Maybe String Source # optionCLParser :: Parser HedgehogReplay Source #

newtype HedgehogShowReplay Source #

If a test case fails, show a replay token for replaying tests

Constructors

HedgehogShowReplay Bool |

#### Instances

Instances details

IsOption HedgehogShowReplay Source # |
Instance details Defined in Test.Tasty.Hedgehog Methods defaultValue :: HedgehogShowReplay Source # parseValue :: String -> Maybe HedgehogShowReplay Source # optionName :: Tagged HedgehogShowReplay String Source # optionHelp :: Tagged HedgehogShowReplay String Source # showDefaultValue :: HedgehogShowReplay -> Maybe String Source # optionCLParser :: Parser HedgehogShowReplay Source #

newtype HedgehogTestLimit Source #

The number of successful test cases required before Hedgehog will pass a test

Constructors

HedgehogTestLimit (Maybe TestLimit) |

#### Instances

Instances details

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

Instance details

Defined in Test.Tasty.Hedgehog

Methods

compare :: HedgehogTestLimit -> HedgehogTestLimit -> Ordering Source #

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

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

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

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

max :: HedgehogTestLimit -> HedgehogTestLimit -> HedgehogTestLimit Source #

min :: HedgehogTestLimit -> HedgehogTestLimit -> HedgehogTestLimit Source #

IsOption HedgehogTestLimit Source # |
Instance details Defined in Test.Tasty.Hedgehog Methods defaultValue :: HedgehogTestLimit Source # parseValue :: String -> Maybe HedgehogTestLimit Source # optionName :: Tagged HedgehogTestLimit String Source # optionHelp :: Tagged HedgehogTestLimit String Source # showDefaultValue :: HedgehogTestLimit -> Maybe String Source # optionCLParser :: Parser HedgehogTestLimit Source #

newtype HedgehogDiscardLimit Source #

The number of discarded cases allowed before Hedgehog will fail a test

Constructors

HedgehogDiscardLimit (Maybe DiscardLimit) |

#### Instances

Instances details

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

Instance details

Defined in Test.Tasty.Hedgehog

Methods

compare :: HedgehogDiscardLimit -> HedgehogDiscardLimit -> Ordering Source #

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

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

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

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

max :: HedgehogDiscardLimit -> HedgehogDiscardLimit -> HedgehogDiscardLimit Source #

min :: HedgehogDiscardLimit -> HedgehogDiscardLimit -> HedgehogDiscardLimit Source #

IsOption HedgehogDiscardLimit Source # |
Instance details Defined in Test.Tasty.Hedgehog Methods defaultValue :: HedgehogDiscardLimit Source # parseValue :: String -> Maybe HedgehogDiscardLimit Source # optionName :: Tagged HedgehogDiscardLimit String Source # optionHelp :: Tagged HedgehogDiscardLimit String Source # showDefaultValue :: HedgehogDiscardLimit -> Maybe String Source # optionCLParser :: Parser HedgehogDiscardLimit Source #

newtype HedgehogShrinkLimit Source #

The number of shrinks allowed before Hedgehog will fail a test

Constructors

HedgehogShrinkLimit (Maybe ShrinkLimit) |

#### Instances

Instances details

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

Instance details

Defined in Test.Tasty.Hedgehog

Methods

compare :: HedgehogShrinkLimit -> HedgehogShrinkLimit -> Ordering Source #

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

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

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

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

max :: HedgehogShrinkLimit -> HedgehogShrinkLimit -> HedgehogShrinkLimit Source #

min :: HedgehogShrinkLimit -> HedgehogShrinkLimit -> HedgehogShrinkLimit Source #

IsOption HedgehogShrinkLimit Source # |
Instance details Defined in Test.Tasty.Hedgehog Methods defaultValue :: HedgehogShrinkLimit Source # parseValue :: String -> Maybe HedgehogShrinkLimit Source # optionName :: Tagged HedgehogShrinkLimit String Source # optionHelp :: Tagged HedgehogShrinkLimit String Source # showDefaultValue :: HedgehogShrinkLimit -> Maybe String Source # optionCLParser :: Parser HedgehogShrinkLimit Source #

newtype HedgehogShrinkRetries Source #

The number of times to re-run a test during shrinking

Constructors

HedgehogShrinkRetries (Maybe ShrinkRetries) |

#### Instances

Instances details

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

Instance details

Defined in Test.Tasty.Hedgehog

Methods

compare :: HedgehogShrinkRetries -> HedgehogShrinkRetries -> Ordering Source #

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

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

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

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

max :: HedgehogShrinkRetries -> HedgehogShrinkRetries -> HedgehogShrinkRetries Source #

min :: HedgehogShrinkRetries -> HedgehogShrinkRetries -> HedgehogShrinkRetries Source #

IsOption HedgehogShrinkRetries Source # |

Instance details

Defined in Test.Tasty.Hedgehog

Methods

defaultValue :: HedgehogShrinkRetries Source #

parseValue :: String -> Maybe HedgehogShrinkRetries Source #

optionName :: Tagged HedgehogShrinkRetries String Source #

optionHelp :: Tagged HedgehogShrinkRetries String Source #

showDefaultValue :: HedgehogShrinkRetries -> Maybe String Source #

optionCLParser :: Parser HedgehogShrinkRetries Source #