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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Test.Validity.Arbitrary

Description

Tests for Arbitrary instances involving Validity

You will need `TypeApplications` to use these.

Synopsis

- arbitrarySpec :: forall a. (Typeable a, Show a, Validity a, Arbitrary a) => Spec
- arbitraryGeneratesOnlyValid :: forall a. (Show a, Validity a, Arbitrary a) => Property

# Documentation

arbitrarySpec :: forall a. (Typeable a, Show a, Validity a, Arbitrary a) => Spec Source #

A `Spec` that specifies that `arbitrary` only generates data that satisfy `isValid`

Example usage:

    arbitrarySpec @Int

arbitraryGeneratesOnlyValid :: forall a. (Show a, Validity a, Arbitrary a) => Property Source #

`arbitrary` only generates valid data

    arbitraryGeneratesOnlyValid @Int