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

Safe HaskellNone
LanguageHaskell2010

Test.Validity.GenRelativeValidity

Description

Tests for GenRelativeValidity instances

You will need TypeApplications to use these.

Synopsis

Documentation

genRelativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenUnchecked b, GenValid b, GenRelativeValid a b, GenRelativeInvalid a 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 @MyDataFor @MyOtherData

genRelativeValidGeneratesValid :: forall a b. (Show a, Show b, GenValid b, RelativeValidity a b, GenRelativeValid a b) => Property Source #

genValidFor b only generates values that satisfy isValidFor b

genRelativeInvalidGeneratesInvalid :: forall a b. (Show a, Show b, GenUnchecked b, RelativeValidity a b, GenRelativeInvalid a b) => Property Source #

genInvalidFor b only generates values that do not satisfy isValidFor b