constrained-generators-0.2.0.0: Framework for generating constrained random data using a subset of first order logic
Safe HaskellSafe-Inferred
LanguageHaskell2010

Constrained.Test

Description

Useful properties for debugging HasSpec instances and this library itself

Synopsis

Documentation

prop_completeHasSpec a ⇒ Specification a → Property Source #

`prop_complete ps` assumes that ps is satisfiable

prop_conformEmpty ∷ ∀ a. HasSpec a ⇒ a → Property Source #

mainIO () Source #

showCtxWith ∷ ∀ fn as b. AppRequires fn as b ⇒ fn as b → TestableCtx as → String Source #

data TestableFn where Source #

Constructors

TestableFn ∷ (Arbitrary (Specification b), Typeable (FunTy as b), AppRequires t as b) ⇒ t as b → TestableFn 

Instances

Instances details
Arbitrary TestableFn Source # 
Instance details

Defined in Constrained.Test

Show TestableFn Source # 
Instance details

Defined in Constrained.Test

prop_mapSpec ∷ (HasSpec a, AppRequires t '[a] b) ⇒ t '[a] b → Specification a → Property Source #

prop_propagateSpecSound ∷ (HasSpec a, AppRequires t '[a] b) ⇒ t '[a] b → b → Property Source #

data TestableCtx as where Source #

Constructors

TestableCtxHasSpec a ⇒ ListCtx Value as (HOLE a) → TestableCtx as 

Instances

Instances details
(All HasSpec as, TypeList as) ⇒ Arbitrary (TestableCtx as) Source # 
Instance details

Defined in Constrained.Test

Orphan instances

(HasSpec a, Arbitrary (TypeSpec a)) ⇒ Arbitrary (Specification a) Source # 
Instance details

(Ord a, Arbitrary (Specification a), Arbitrary a) ⇒ Arbitrary (SetSpec a) Source # 
Instance details

Methods

arbitraryGen (SetSpec a) Source #

shrinkSetSpec a → [SetSpec a] Source #

Arbitrary (FoldSpec (Map k v)) Source # 
Instance details

Methods

arbitraryGen (FoldSpec (Map k v)) Source #

shrinkFoldSpec (Map k v) → [FoldSpec (Map k v)] Source #

Arbitrary (FoldSpec (Set a)) Source # 
Instance details

Methods

arbitraryGen (FoldSpec (Set a)) Source #

shrinkFoldSpec (Set a) → [FoldSpec (Set a)] Source #

(Arbitrary (Specification a), Foldy a) ⇒ Arbitrary (FoldSpec a) Source # 
Instance details

(Arbitrary a, Arbitrary (FoldSpec a), Arbitrary (TypeSpec a), HasSpec a) ⇒ Arbitrary (ListSpec a) Source # 
Instance details

(Arbitrary (Specification a), Arbitrary (Specification b)) ⇒ Arbitrary (SumSpec a b) Source # 
Instance details

Methods

arbitraryGen (SumSpec a b) Source #

shrinkSumSpec a b → [SumSpec a b] Source #

(Arbitrary k, Arbitrary v, Arbitrary (TypeSpec k), Arbitrary (TypeSpec v), Ord k, HasSpec k, Foldy v) ⇒ Arbitrary (MapSpec k v) Source # 
Instance details

Methods

arbitraryGen (MapSpec k v) Source #

shrinkMapSpec k v → [MapSpec k v] Source #

(Arbitrary (Specification a), Arbitrary (Specification b)) ⇒ Arbitrary (PairSpec a b) Source # 
Instance details

Methods

arbitraryGen (PairSpec a b) Source #

shrinkPairSpec a b → [PairSpec a b] Source #