foundation-0.0.29: Alternative prelude with batteries and no dependencies
License BSD-style
Maintainer Foundation maintainers
Safe Haskell None
Language Haskell2010

Foundation.Check

Description

An implementation of a test framework and property expression & testing

Synopsis

Documentation

class Arbitrary a where Source #

How to generate an arbitrary value for a

Instances

Instances details
Arbitrary Bool Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Char Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Double Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Float Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Int Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Int8 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Int16 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Int32 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Int64 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Integer Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Natural Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word8 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word16 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word32 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word64 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary String Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary AsciiString Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word256 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Word128 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Char7 Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary Field Source #
Instance details

Defined in Foundation.Format.CSV.Types

Arbitrary a => Arbitrary [a] Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary a => Arbitrary ( Maybe a) Source #
Instance details

Defined in Foundation.Check.Arbitrary

Arbitrary ( CountOf ty) Source #
Instance details

Defined in Foundation.Check.Arbitrary

( NatWithinBound Word64 n, KnownNat n) => Arbitrary ( Zn64 n) Source #
Instance details

Defined in Foundation.Check.Arbitrary

KnownNat n => Arbitrary ( Zn n) Source #
Instance details

Defined in Foundation.Check.Arbitrary

( Arbitrary l, Arbitrary r) => Arbitrary ( Either l r) Source #
Instance details

Defined in Foundation.Check.Arbitrary

( Arbitrary a, Arbitrary b) => Arbitrary (a, b) Source #
Instance details

Defined in Foundation.Check.Arbitrary

( Arbitrary a, KnownNat n, NatWithinBound Int n) => Arbitrary ( ListN n a) Source #
Instance details

Defined in Foundation.Check.Arbitrary

( Arbitrary a, Arbitrary b, Arbitrary c) => Arbitrary (a, b, c) Source #
Instance details

Defined in Foundation.Check.Arbitrary

Methods

arbitrary :: Gen (a, b, c) Source #

( Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => Arbitrary (a, b, c, d) Source #
Instance details

Defined in Foundation.Check.Arbitrary

Methods

arbitrary :: Gen (a, b, c, d) Source #

( Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e) => Arbitrary (a, b, c, d, e) Source #
Instance details

Defined in Foundation.Check.Arbitrary

Methods

arbitrary :: Gen (a, b, c, d, e) Source #

( Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f) => Arbitrary (a, b, c, d, e, f) Source #
Instance details

Defined in Foundation.Check.Arbitrary

Methods

arbitrary :: Gen (a, b, c, d, e, f) Source #

frequency :: NonEmpty [( Word , Gen a)] -> Gen a Source #

Call one of the generator weighted

data Test where Source #

different type of tests supported

Property

data PropertyCheck Source #

The type of check this test did for a property

data Property Source #

Constructors

Prop

Fields

(===) :: ( Show a, Eq a, Typeable a) => a -> a -> PropertyCheck infix 4 Source #

A property that check for equality of its 2 members.

propertyCompare Source #

Arguments

:: ( Show a, Typeable a)
=> String

name of the function used for comparaison, e.g. (<)

-> (a -> a -> Bool )

function used for value comparaison

-> a

value left of the operator

-> a

value right of the operator

-> PropertyCheck

A property that check for a specific comparaison of its 2 members.

This is equivalent to === but with compare

propertyCompareWith Source #

Arguments

:: String

name of the function used for comparaison, e.g. (<)

-> (a -> a -> Bool )

function used for value comparaison

-> (a -> String )

function used to pretty print the values

-> a

value left of the operator

-> a

value right of the operator

-> PropertyCheck

A property that check for a specific comparaison of its 2 members.

This is equivalent to === but with compare and a given method to pretty print the values.

propertyAnd :: PropertyCheck -> PropertyCheck -> PropertyCheck Source #

A conjuctive property composed of 2 properties that need to pass

forAll :: ( Show a, IsProperty prop) => Gen a -> (a -> prop) -> Property Source #

Running a generator for a specific type under a property

Check Plan

iterateProperty :: CountOf TestResult -> GenParams -> ( Word64 -> GenRng) -> Property -> IO (PropertyResult, CountOf TestResult) Source #