hspec-wai-0.10.1: Experimental Hspec support for testing WAI applications

Safe Haskell | None
Language | Haskell2010

Test.Hspec.Wai.QuickCheck

Contents

- Re-exports
- Internals

Synopsis

- property :: Testable a => a -> (State a, Application) -> Property
- (==>) :: Testable prop => Bool -> prop -> WaiProperty (State prop)
- class Arbitrary a where
  - arbitrary :: Gen a
  - shrink :: a -> [a]
- module Test.QuickCheck.Gen
- class Testable a where
  - type State a
  - toProperty :: a -> WaiProperty (State a)
- data WaiProperty st = WaiProperty {
  - unWaiProperty :: (st, Application) -> Property
  }

# Documentation

property :: Testable a => a -> (State a, Application) -> Property Source #

(==>) :: Testable prop => Bool -> prop -> WaiProperty (State prop) infixr 0 Source #

# Re-exports

class Arbitrary a where Source #

Random generation and shrinking of values.

QuickCheck provides `Arbitrary` instances for most types in `base`, except those which incur extra dependencies. For a wider range of `Arbitrary` instances see the quickcheck-instances package.

Minimal complete definition

arbitrary

Methods

arbitrary :: Gen a Source #

A generator for values of the given type.

It is worth spending time thinking about what sort of test data you want - good generators are often the difference between finding bugs and not finding them. You can use `sample`, `label` and `classify` to check the quality of your test data.

There is no generic `arbitrary` implementation included because we don't know how to make a high-quality one. If you want one, consider using the testing-feat or generic-random packages.

The QuickCheck manual goes into detail on how to write good generators. Make sure to look at it, especially if your type is recursive!

shrink :: a -> [a] Source #

Produces a (possibly) empty list of all the possible immediate shrinks of the given value.

The default implementation returns the empty list, so will not try to shrink the value. If your data type has no special invariants, you can enable shrinking by defining `shrink = `genericShrink``, but by customising the behaviour of `shrink` you can often get simpler counterexamples.

Most implementations of `shrink` should try at least three things:

1. Shrink a term to any of its immediate subterms. You can use `subterms` to do this.
2. Recursively apply `shrink` to all immediate subterms. You can use `recursivelyShrink` to do this.
3. Type-specific shrinkings such as replacing a constructor by a simpler constructor.

For example, suppose we have the following implementation of binary trees:

    data Tree a = Nil | Branch a (Tree a) (Tree a)

We can then define `shrink` as follows:

    shrink Nil = []
    shrink (Branch x l r) =
      -- shrink Branch to Nil
      [Nil] ++
      -- shrink to subterms
      [l, r] ++
      -- recursively shrink subterms
      [Branch x' l' r' | (x', l', r') <- shrink (x, l, r)]

There are a couple of subtleties here:

- QuickCheck tries the shrinking candidates in the order they appear in the list, so we put more aggressive shrinking steps (such as replacing the whole tree by `Nil`) before smaller ones (such as recursively shrinking the subtrees).
- It is tempting to write the last line as `[Branch x' l' r' | x' <- shrink x, l' <- shrink l, r' <- shrink r]` but this is the wrong thing! It will force QuickCheck to shrink `x`, `l` and `r` in tandem, and shrinking will stop once one of the three is fully shrunk.

There is a fair bit of boilerplate in the code above. We can avoid it with the help of some generic functions. The function `genericShrink` tries shrinking a term to all of its subterms and, failing that, recursively shrinks the subterms. Using it, we can define `shrink` as:

    shrink x = shrinkToNil x ++ genericShrink x
      where
        shrinkToNil Nil = []
        shrinkToNil (Branch _ l r) = [Nil]

`genericShrink` is a combination of `subterms`, which shrinks a term to any of its subterms, and `recursivelyShrink`, which shrinks all subterms of a term. These may be useful if you need a bit more control over shrinking than `genericShrink` gives you.

A final gotcha: we cannot define `shrink` as simply ``shrink` x = Nil:`genericShrink` x` as this shrinks `Nil` to `Nil`, and shrinking will go into an infinite loop.

If all this leaves you bewildered, you might try ``shrink` = `genericShrink`` to begin with, after deriving `Generic` for your type. However, if your data type has any special invariants, you will need to check that `genericShrink` can't break those invariants.

#### Instances

Instances details

Arbitrary Bool |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Bool Source # shrink :: Bool -> [Bool] Source #
Arbitrary Char |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Char Source # shrink :: Char -> [Char] Source #
Arbitrary Double |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Double Source # shrink :: Double -> [Double] Source #
Arbitrary Float |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Float Source # shrink :: Float -> [Float] Source #
Arbitrary Int |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Int Source # shrink :: Int -> [Int] Source #
Arbitrary Int8 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Int8 Source # shrink :: Int8 -> [Int8] Source #
Arbitrary Int16 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Int16 Source # shrink :: Int16 -> [Int16] Source #
Arbitrary Int32 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Int32 Source # shrink :: Int32 -> [Int32] Source #
Arbitrary Int64 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Int64 Source # shrink :: Int64 -> [Int64] Source #
Arbitrary Integer |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Integer Source # shrink :: Integer -> [Integer] Source #
Arbitrary Ordering |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Ordering Source # shrink :: Ordering -> [Ordering] Source #
Arbitrary Word |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Word Source # shrink :: Word -> [Word] Source #
Arbitrary Word8 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Word8 Source # shrink :: Word8 -> [Word8] Source #
Arbitrary Word16 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Word16 Source # shrink :: Word16 -> [Word16] Source #
Arbitrary Word32 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Word32 Source # shrink :: Word32 -> [Word32] Source #
Arbitrary Word64 |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Word64 Source # shrink :: Word64 -> [Word64] Source #
Arbitrary () |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen () Source # shrink :: () -> [()] Source #
Arbitrary Version | Generates `Version` with non-empty non-negative `versionBranch`, and empty `versionTags`
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Version Source # shrink :: Version -> [Version] Source #
Arbitrary QCGen |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen QCGen Source # shrink :: QCGen -> [QCGen] Source #
Arbitrary ASCIIString |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen ASCIIString Source # shrink :: ASCIIString -> [ASCIIString] Source #
Arbitrary UnicodeString |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen UnicodeString Source # shrink :: UnicodeString -> [UnicodeString] Source #
Arbitrary PrintableString |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen PrintableString Source # shrink :: PrintableString -> [PrintableString] Source #
Arbitrary ExitCode |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen ExitCode Source # shrink :: ExitCode -> [ExitCode] Source #
Arbitrary All |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen All Source # shrink :: All -> [All] Source #
Arbitrary Any |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen Any Source # shrink :: Any -> [Any] Source #
Arbitrary CChar |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CChar Source # shrink :: CChar -> [CChar] Source #
Arbitrary CInt |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CInt Source # shrink :: CInt -> [CInt] Source #
Arbitrary CSize |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CSize Source # shrink :: CSize -> [CSize] Source #
Arbitrary CULong |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CULong Source # shrink :: CULong -> [CULong] Source #
Arbitrary IntSet |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen IntSet Source # shrink :: IntSet -> [IntSet] Source #
Arbitrary CClock |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CClock Source # shrink :: CClock -> [CClock] Source #
Arbitrary CDouble |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CDouble Source # shrink :: CDouble -> [CDouble] Source #
Arbitrary CFloat |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CFloat Source # shrink :: CFloat -> [CFloat] Source #
Arbitrary CIntMax |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CIntMax Source # shrink :: CIntMax -> [CIntMax] Source #
Arbitrary CIntPtr |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CIntPtr Source # shrink :: CIntPtr -> [CIntPtr] Source #
Arbitrary CLLong |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CLLong Source # shrink :: CLLong -> [CLLong] Source #
Arbitrary CLong |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CLong Source # shrink :: CLong -> [CLong] Source #
Arbitrary CPtrdiff |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CPtrdiff Source # shrink :: CPtrdiff -> [CPtrdiff] Source #
Arbitrary CSChar |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CSChar Source # shrink :: CSChar -> [CSChar] Source #
Arbitrary CSUSeconds |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CSUSeconds Source # shrink :: CSUSeconds -> [CSUSeconds] Source #
Arbitrary CShort |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CShort Source # shrink :: CShort -> [CShort] Source #
Arbitrary CSigAtomic |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CSigAtomic Source # shrink :: CSigAtomic -> [CSigAtomic] Source #
Arbitrary CTime |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CTime Source # shrink :: CTime -> [CTime] Source #
Arbitrary CUChar |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CUChar Source # shrink :: CUChar -> [CUChar] Source #
Arbitrary CUInt |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CUInt Source # shrink :: CUInt -> [CUInt] Source #
Arbitrary CUIntMax |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CUIntMax Source # shrink :: CUIntMax -> [CUIntMax] Source #
Arbitrary CUIntPtr |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CUIntPtr Source # shrink :: CUIntPtr -> [CUIntPtr] Source #
Arbitrary CULLong |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CULLong Source # shrink :: CULLong -> [CULLong] Source #
Arbitrary CUSeconds |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CUSeconds Source # shrink :: CUSeconds -> [CUSeconds] Source #
Arbitrary CUShort |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CUShort Source # shrink :: CUShort -> [CUShort] Source #
Arbitrary CWchar |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen CWchar Source # shrink :: CWchar -> [CWchar] Source #
Arbitrary a => Arbitrary [a] |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen [a] Source # shrink :: [a] -> [[a]] Source #
Arbitrary a => Arbitrary (Maybe a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Maybe a) Source # shrink :: Maybe a -> [Maybe a] Source #
Integral a => Arbitrary (Ratio a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Ratio a) Source # shrink :: Ratio a -> [Ratio a] Source #
Arbitrary a => Arbitrary (Blind a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Blind a) Source # shrink :: Blind a -> [Blind a] Source #
Arbitrary a => Arbitrary (Fixed a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Fixed a) Source # shrink :: Fixed a -> [Fixed a] Source #
(Ord a, Arbitrary a) => Arbitrary (OrderedList a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (OrderedList a) Source # shrink :: OrderedList a -> [OrderedList a] Source #
Arbitrary a => Arbitrary (NonEmptyList a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (NonEmptyList a) Source # shrink :: NonEmptyList a -> [NonEmptyList a] Source #
Arbitrary a => Arbitrary (InfiniteList a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (InfiniteList a) Source # shrink :: InfiniteList a -> [InfiniteList a] Source #
(Arbitrary a, Ord a) => Arbitrary (SortedList a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (SortedList a) Source # shrink :: SortedList a -> [SortedList a] Source #
(Num a, Ord a, Arbitrary a) => Arbitrary (Positive a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Positive a) Source # shrink :: Positive a -> [Positive a] Source #
(Num a, Ord a, Arbitrary a) => Arbitrary (Negative a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Negative a) Source # shrink :: Negative a -> [Negative a] Source #
(Num a, Eq a, Arbitrary a) => Arbitrary (NonZero a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (NonZero a) Source # shrink :: NonZero a -> [NonZero a] Source #
(Num a, Ord a, Arbitrary a) => Arbitrary (NonNegative a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (NonNegative a) Source # shrink :: NonNegative a -> [NonNegative a] Source #
(Num a, Ord a, Arbitrary a) => Arbitrary (NonPositive a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (NonPositive a) Source # shrink :: NonPositive a -> [NonPositive a] Source #
(Integral a, Bounded a) => Arbitrary (Large a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Large a) Source # shrink :: Large a -> [Large a] Source #
Integral a => Arbitrary (Small a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Small a) Source # shrink :: Small a -> [Small a] Source #
Arbitrary a => Arbitrary (Shrink2 a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Shrink2 a) Source # shrink :: Shrink2 a -> [Shrink2 a] Source #
Arbitrary a => Arbitrary (Smart a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Smart a) Source # shrink :: Smart a -> [Smart a] Source #
Arbitrary a => Arbitrary (Identity a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Identity a) Source # shrink :: Identity a -> [Identity a] Source #
(RealFloat a, Arbitrary a) => Arbitrary (Complex a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Complex a) Source # shrink :: Complex a -> [Complex a] Source #
(Arbitrary a, CoArbitrary a) => Arbitrary (Endo a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Endo a) Source # shrink :: Endo a -> [Endo a] Source #
Arbitrary a => Arbitrary (Sum a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Sum a) Source # shrink :: Sum a -> [Sum a] Source #
Arbitrary a => Arbitrary (Product a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Product a) Source # shrink :: Product a -> [Product a] Source #
Arbitrary a => Arbitrary (Last a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Last a) Source # shrink :: Last a -> [Last a] Source #
Arbitrary a => Arbitrary (First a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (First a) Source # shrink :: First a -> [First a] Source #
Arbitrary a => Arbitrary (Dual a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Dual a) Source # shrink :: Dual a -> [Dual a] Source #
Arbitrary a => Arbitrary (ZipList a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (ZipList a) Source # shrink :: ZipList a -> [ZipList a] Source #
Arbitrary a => Arbitrary (Seq a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Seq a) Source # shrink :: Seq a -> [Seq a] Source #
HasResolution a => Arbitrary (Fixed a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Fixed a) Source # shrink :: Fixed a -> [Fixed a] Source #
Arbitrary a => Arbitrary (IntMap a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (IntMap a) Source # shrink :: IntMap a -> [IntMap a] Source #
(Ord a, Arbitrary a) => Arbitrary (Set a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Set a) Source # shrink :: Set a -> [Set a] Source #
Arbitrary a => Arbitrary (InfiniteListInternalData a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (InfiniteListInternalData a) Source # shrink :: InfiniteListInternalData a -> [InfiniteListInternalData a] Source #
(CoArbitrary a, Arbitrary b) => Arbitrary (a -> b) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a -> b) Source # shrink :: (a -> b) -> [a -> b] Source #
(Arbitrary a, Arbitrary b) => Arbitrary (Either a b) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Either a b) Source # shrink :: Either a b -> [Either a b] Source #
(Arbitrary a, Arbitrary b) => Arbitrary (a, b) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b) Source # shrink :: (a, b) -> [(a, b)] Source #
(Function a, CoArbitrary a, Arbitrary b) => Arbitrary (a :-> b) |
Instance details Defined in Test.QuickCheck.Function Methods arbitrary :: Gen (a :-> b) Source # shrink :: (a :-> b) -> [a :-> b] Source #
(Function a, CoArbitrary a, Arbitrary b) => Arbitrary (Fun a b) |
Instance details Defined in Test.QuickCheck.Function Methods arbitrary :: Gen (Fun a b) Source # shrink :: Fun a b -> [Fun a b] Source #
(Arbitrary a, ShrinkState s a) => Arbitrary (Shrinking s a) |
Instance details Defined in Test.QuickCheck.Modifiers Methods arbitrary :: Gen (Shrinking s a) Source # shrink :: Shrinking s a -> [Shrinking s a] Source #
Arbitrary (m a) => Arbitrary (WrappedMonad m a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (WrappedMonad m a) Source # shrink :: WrappedMonad m a -> [WrappedMonad m a] Source #
(Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map k v) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Map k v) Source # shrink :: Map k v -> [Map k v] Source #
(Arbitrary a, Arbitrary b, Arbitrary c) => Arbitrary (a, b, c) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c) Source # shrink :: (a, b, c) -> [(a, b, c)] Source #
Arbitrary a => Arbitrary (Const a b) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Const a b) Source # shrink :: Const a b -> [Const a b] Source #
Arbitrary (f a) => Arbitrary (Alt f a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Alt f a) Source # shrink :: Alt f a -> [Alt f a] Source #
Arbitrary (a b c) => Arbitrary (WrappedArrow a b c) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (WrappedArrow a b c) Source # shrink :: WrappedArrow a b c -> [WrappedArrow a b c] Source #
Arbitrary a => Arbitrary (Constant a b) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Constant a b) Source # shrink :: Constant a b -> [Constant a b] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => Arbitrary (a, b, c, d) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d) Source # shrink :: (a, b, c, d) -> [(a, b, c, d)] Source #
(Arbitrary1 f, Arbitrary1 g, Arbitrary a) => Arbitrary (Product f g a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Product f g a) Source # shrink :: Product f g a -> [Product f g a] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e) => Arbitrary (a, b, c, d, e) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d, e) Source # shrink :: (a, b, c, d, e) -> [(a, b, c, d, e)] Source #
(Arbitrary1 f, Arbitrary1 g, Arbitrary a) => Arbitrary (Compose f g a) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (Compose f g a) Source # shrink :: Compose f g a -> [Compose f g a] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f) => Arbitrary (a, b, c, d, e, f) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d, e, f) Source # shrink :: (a, b, c, d, e, f) -> [(a, b, c, d, e, f)] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g) => Arbitrary (a, b, c, d, e, f, g) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d, e, f, g) Source # shrink :: (a, b, c, d, e, f, g) -> [(a, b, c, d, e, f, g)] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h) => Arbitrary (a, b, c, d, e, f, g, h) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d, e, f, g, h) Source # shrink :: (a, b, c, d, e, f, g, h) -> [(a, b, c, d, e, f, g, h)] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h, Arbitrary i) => Arbitrary (a, b, c, d, e, f, g, h, i) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d, e, f, g, h, i) Source # shrink :: (a, b, c, d, e, f, g, h, i) -> [(a, b, c, d, e, f, g, h, i)] Source #
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h, Arbitrary i, Arbitrary j) => Arbitrary (a, b, c, d, e, f, g, h, i, j) |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen (a, b, c, d, e, f, g, h, i, j) Source # shrink :: (a, b, c, d, e, f, g, h, i, j) -> [(a, b, c, d, e, f, g, h, i, j)] Source #

module Test.QuickCheck.Gen

# Internals

class Testable a where Source #

Associated Types

type State a Source #

Methods

toProperty :: a -> WaiProperty (State a) Source #

#### Instances

Instances details

Testable (WaiExpectation st) Source # |
Instance details Defined in Test.Hspec.Wai.QuickCheck Associated Types type State (WaiExpectation st) Source # Methods toProperty :: WaiExpectation st -> WaiProperty (State (WaiExpectation st)) Source #
Testable (WaiProperty st) Source # |
Instance details Defined in Test.Hspec.Wai.QuickCheck Associated Types type State (WaiProperty st) Source # Methods toProperty :: WaiProperty st -> WaiProperty (State (WaiProperty st)) Source #
(Arbitrary a, Show a, Testable prop) => Testable (a -> prop) Source # |
Instance details Defined in Test.Hspec.Wai.QuickCheck Associated Types type State (a -> prop) Source # Methods toProperty :: (a -> prop) -> WaiProperty (State (a -> prop)) Source #

data WaiProperty st Source #

Constructors

WaiProperty |

Fields

- unWaiProperty :: (st, Application) -> Property

#### Instances

Instances details

Testable (WaiProperty st) Source # |
Instance details Defined in Test.Hspec.Wai.QuickCheck Associated Types type State (WaiProperty st) Source # Methods toProperty :: WaiProperty st -> WaiProperty (State (WaiProperty st)) Source #
type State (WaiProperty st) Source # |
Instance details Defined in Test.Hspec.Wai.QuickCheck type State (WaiProperty st) = st