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

Safe HaskellNone
LanguageHaskell2010

Test.Validity.GenRelativeValidity

Contents

Synopsis

Tests for GenRelativeValidity instances

genRelativeValiditySpec :: (Typeable a, Typeable b, Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Spec Source #

A Spec that specifies that genValidFor and genInvalidFor work as intended.

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

Example usage:

relativeGenValiditySpec (proxy :: MyDataFor) (proxy :: MyOtherData)

genRelativeValidityValidGeneratesValid :: (Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Property Source #

genValidFor b only generates values that satisfy isValidFor b

genRelativeValidityInvalidGeneratesInvalid :: (Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Property Source #

genInvalidFor b only generates values that do not satisfy isValidFor b