genvalidity-hspec-0.2.0.5: Standard spec's for GenValidity instances

Safe HaskellNone
LanguageHaskell2010

Test.Validity.GenValidity

Contents

Synopsis

Tests for GenValidity instances

genValiditySpec :: (Typeable a, Show a, GenValidity a) => Proxy a -> Spec Source #

A Spec that specifies that genValid only generates valid data and that genInvalid only generates invalid data.

In general it is a good idea to add this spec to your test suite if you write a custom implementation of genValid or genInvalid.

Example usage:

genValiditySpec (Proxy :: Proxy MyData)

genValidityValidGeneratesValid :: forall a. (Show a, GenValidity a) => Proxy a -> Property Source #

genValid only generates valid data

genGeneratesValid :: (Show a, Validity a) => Gen a -> Property Source #

The given generator generates only valid data points

genValidityInvalidGeneratesInvalid :: forall a. (Show a, GenValidity a) => Proxy a -> Property Source #

genValid only generates invalid data

genGeneratesInvalid :: (Show a, Validity a) => Gen a -> Property Source #

The given generator generates only invalid data points