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

sum3WithLength ∷ Integer → Specification BaseFn ([Int], Int, Int, Int) Source #

listSumComplexNumbery a ⇒ a → Specification BaseFn [a] Source #

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

data Outcome Source #

Constructors

Succeed 
Fail 

propYes ∷ String → Solution t → Property Source #

propNo ∷ Show t ⇒ String → Solution t → Property Source #

parensList ∷ [String] → String 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 BaseFn a, Random a, Integral a, TypeSpec BaseFn a ~ NumSpec BaseFn a) ⇒ Specification BaseFn Integer → Specification BaseFn a → Specification BaseFn a → OutcomeGen Property Source #

Build properties about calls to genListWithSize

sumProp ∷ (Integral t, Random t, HasSpec BaseFn t) ⇒ t → t → Specification BaseFn t → t → Int → OutcomeGen 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 → Int → OutcomeGen 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.