extrapolate-0.0.1: generalize counter-examples of test properties

Copyright(c) 2017 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellNone
LanguageHaskell2010

Test.Extrapolate.IO

Description

This module is part of Extrapolate, a library for generalization of counter-examples.

QuickCheck-like interface.

Synopsis

Documentation

check :: Testable a => a -> IO () Source #

Checks a property printing results on stdout

> check $ \xs -> sort (sort xs) == sort (xs::[Int])
+++ OK, passed 360 tests.
> check $ \xs ys -> xs `union` ys == ys `union` (xs::[Int])
*** Failed! Falsifiable (after 4 tests):
[] [0,0]
Generalization:
[] (x:x:xs)

checkResult :: Testable a => a -> IO Bool Source #

Check a property printing results on stdout and returning True on success.

There is no option to silence this function: for silence, you should use holds.

for :: Testable a => (WithOption a -> b) -> Int -> a -> b Source #

withInstances :: Testable a => (WithOption a -> b) -> Instances -> a -> b Source #

withBackground :: Testable a => (WithOption a -> b) -> [Expr] -> a -> b Source #

withConditionSize :: Testable a => (WithOption a -> b) -> Int -> a -> b Source #