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

Constrained.Examples.Fold

Synopsis

Documentation

listSumComplexNumbery a ⇒ a → Specification [a] Source #

Complicated, because if a is too large, the spec is unsatisfiable.

data Outcome Source #

Constructors

Succeed 
Fail 

propNoShow t ⇒ StringSolution t → Property Source #

picktest ∷ (Ord a, Num a) ⇒ a → a → (a → Bool) → a → Int → [a] → Bool Source #

pickPropGen Property Source #

generate a different category of test, each time.

testFoldSpec ∷ ∀ a. (Foldy a, Random a, Integral a, TypeSpec a ~ NumSpec a, Arbitrary a, MaybeBounded a) ⇒ Specification IntegerSpecification a → Specification a → OutcomeGen Property Source #

Build properties about calls to genListWithSize

sumProp ∷ (Integral t, Random t, HasSpec t) ⇒ t → t → Specification t → t → IntOutcomeGen Property Source #

Generate a property from a call to pickAll. We can test for success or failure using outcome

sumProp2 ∷ (Show t, Integral t, Random t) ⇒ t → t → (String, t → Bool) → t → IntOutcomeGen Property Source #

Like SumProp, but instead of using a (Specification fn n) for the element predicate It uses an explicit pair of a (String, n -> Bool). This means we can test things using any Haskell function.