| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Validity.RelativeValidity
Description
Tests for RelativeValidity instances
You will need TypeApplications to use these.
- relativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, Validity a, Validity b, GenUnchecked a, GenUnchecked b, RelativeValidity a b) => Spec
- relativeValidityImpliesValidA :: forall a b. (Show a, Show b, Validity a, GenUnchecked a, GenUnchecked b, RelativeValidity a b) => Property
- relativeValidityImpliesValidB :: forall a b. (Show a, Show b, Validity b, GenUnchecked a, GenUnchecked b, RelativeValidity a b) => Property
Documentation
relativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, Validity a, Validity b, GenUnchecked a, GenUnchecked b, RelativeValidity a b) => Spec Source #
A Spec that specifies that isValidFor implies isValid
In general it is a good idea to add this spec to your test suite if
the a and b in RelativeValidity a b also have a Validity instance.
Example usage:
relativeValiditySpec @MyDataFor @MyOtherData
relativeValidityImpliesValidA :: forall a b. (Show a, Show b, Validity a, GenUnchecked a, GenUnchecked b, RelativeValidity a b) => Property Source #
isValidFor a b implies isValid a for all b
relativeValidityImpliesValidB :: forall a b. (Show a, Show b, Validity b, GenUnchecked a, GenUnchecked b, RelativeValidity a b) => Property Source #
isValidFor a b implies isValid b for all a