HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulegenvalidity-hspec-1.0.0.4Haskell2010

Test.Validity.GenValidity

Tests for GenValidity instances

You will need TypeApplications to use these.

  • 4 values
valuegenValidSpec :: (Typeable a, Show a, GenValid a) => Spec
#

A Spec that specifies that genValid only generates valid data.

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

Example usage:

genValidSpec @Int

genValid only generates valid data

Property
genValidGeneratesValid @()
Property
genValidGeneratesValid @Bool
Property
genValidGeneratesValid @Ordering
Property
genValidGeneratesValid @Char
Property
genValidGeneratesValid @Int
Property
genValidGeneratesValid @Float
Property
genValidGeneratesValid @Double
Property
genValidGeneratesValid @Integer
Property
genValidGeneratesValid @(Maybe Int)
Property
genValidGeneratesValid @[Int]