QuickCheckVariant-1.0.1.0: Valid and Invalid generator
Copyright(c) Jorge Santiago Alvarez Cuadros 2015
LicenseGPL-3
Maintainersanjorgek@ciencias.unam.mx
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

Test.QuickCheck.Variant

Description

To get random "invalid" and "valid" data

Synopsis

Documentation

class Variant a where Source #

You can define

>>> instance (Variant a) => Arbitrary a where {arbitrary = oneof [valid, invalid]}

Methods

valid :: Gen a Source #

Get a generator of valid random data type

invalid :: Gen a Source #

Get a generator of invalid random data type

class VarTestable prop where Source #

The class of things wich can be tested with invalid or valid input.

Methods

propertyValid :: prop -> Property Source #

Property for valid input

propertyInvalid :: prop -> Property Source #

Property for invalid input

Instances

Instances details
VarTestable Bool Source #

Same as Testeable

Instance details

Defined in Test.QuickCheck.Variant

(Arbitrary a, Variant a, Show a, VarTestable prop) => VarTestable (a -> prop) Source #

Instead of variant we use valid or invalid generators

Instance details

Defined in Test.QuickCheck.Variant

Methods

propertyValid :: (a -> prop) -> Property Source #

propertyInvalid :: (a -> prop) -> Property Source #

mapTotalResultValid :: VarTestable prop => (Result -> Result) -> prop -> Property Source #

mapRoseResultValid :: VarTestable prop => (Rose Result -> Rose Result) -> prop -> Property Source #

mapPropValid :: VarTestable prop => (Prop -> Prop) -> prop -> Property Source #

callbackValid :: VarTestable prop => Callback -> prop -> Property Source #

Adds a callback

counterexampleValid :: VarTestable prop => String -> prop -> Property Source #

Adds the given string to the counterexample if the property fails.

forAllShrinkValid :: (Show a, VarTestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property Source #

Like forAll, but tries to shrink the argument for failing test cases.

mapTotalResultInvalid :: VarTestable prop => (Result -> Result) -> prop -> Property Source #

mapRoseResultInvalid :: VarTestable prop => (Rose Result -> Rose Result) -> prop -> Property Source #

mapPropInvalid :: VarTestable prop => (Prop -> Prop) -> prop -> Property Source #

callbackInvalid :: VarTestable prop => Callback -> prop -> Property Source #

Adds a callback

counterexampleInvalid :: VarTestable prop => String -> prop -> Property Source #

Adds the given string to the counterexample if the property fails.

forAllShrinkInvalid :: (Show a, VarTestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property Source #

Like forAll, but tries to shrink the argument for failing test cases.