QuickCheck

Automatic testing of Haskell programs https://github.com/nick8325/quickcheck

Version on this page:2.9.2
LTS Haskell 9.18:2.9.2
Stackage Nightly 2017-12-15:2.10.1
Latest on Hackage:2.10.1
This is QuickCheck 2, a library for random testing of program properties.

Install it in the usual way:

$ cabal install

There is a Google group for user discussion and questions at
https://groups.google.com/forum/#!forum/haskell-quickcheck.

Changes

QuickCheck 2.10.1 (release 2017-10-06)
* Arbitrary instances for Foreign.C.Types are available in more
GHC versions.
* Fixed a bug where withMaxSuccess didn't adjust the allowed
number of discarded tests.
* Remove quadratic behaviour in terminal output.

QuickCheck 2.10 (released 2017-06-15)
* New combinators:
- withMaxSuccess sets the maximum number of test cases for a property.
- shrinkMap/shrinkMapBy are helpers for defining shrink functions.
- total checks that a value is non-crashing.
- suchThatMap is similar to 'suchThat'
but takes a Maybe-returning function instead of a predicate.
- getSize returns the current test case size.

* Random strings and characters now include Unicode characters by
default. To generate only ASCII characters, use the new
ASCIIString modifier or arbitraryASCIIChar generator.
The following modifiers and generators also control the
kind of strings generated: UnicodeString, PrintableString,
arbitraryUnicodeChar, arbitraryPrintableChar.

* QuickCheck no longer catches asynchronous exceptions, which
means that pressing ctrl-C will now cancel testing without
printing a counterexample. If you are debugging an infinite loop,
please use the 'within' combinator or 'verboseCheck' instead.
('within' is better as it allows the counterexample to be
shrunk.)

* Much of Test.QuickCheck.Function (showable random functions)
is now exported from Test.QuickCheck.
- Test.QuickCheck.Function now defines functions and
pattern synonyms which simplify testing functions of
more than one argument: apply2, apply3, Fn2, Fn3.

* New typeclasses Arbitrary1 and Arbitrary2 which lift Arbitrary
to unary/binary type constructors, like in Data.Functor.Classes.

* Some Arbitrary instances have been removed: NonEmpty, Natural.
This is because they resulted in a lot of extra dependencies.
You can now find them in the quickcheck-instances package.
Alternatively, use the NonEmptyList and NonNegative modifiers.

* New Arbitrary instances for the following types: Proxy, ExitCode,
WrappedMonad, WrappedArrow, QCGen, and the types in
Foreign.C.Types and Data.Functor.{Product,Compose}.
Also a Function instance for Word.

* The functions in Test.QuickCheck.Monadic which take an argument
of type PropertyM m a now expect that 'a' to be Testable, and test it.
To reduce breakage from this, () is now an instance of Testable which
always succeeds.
- PropertyM now has a MonadFail instance on recent GHCs.
Furthermore, the constraints on some instances were loosened.

* Miscellaneous API changes:
- Result now returns the counterexample as a list of strings.
See the "failingTestCase" field.
- Args now has a `maxShrinks` argument, the maximum number of
shrinks to try before giving up shrinking.
- The 'labels' field of Result now encodes frequencies as Doubles
rather than Ints.

* Bugfixes:
- 'Test.QuickCheck.Function', 'Test.QuickCheck.Poly', and
'Test.QuickCheck.Monadic' are now Safe modules.
- Result.theException and Result.reason were taken from
the pre-shrunk counterexample, not the shrunk one.
- The Testable Property instance improperly used 'again'.
- Gen.>>= is strict in the result of split, fixing a space leak.
- within now gives a better error message on timeout

* Some more examples and links have been added to the documentation.

QuickCheck 2.9.2 (released 2016-09-15)
* Fix a bug where some properties were only being tested once
* Make shrinking of floating-point values less aggressive
* Add function chooseAny :: Random a => Gen a

QuickCheck 2.9.1 (released 2016-07-11)
* 'again' was only used in forAllShrink, not forAll

QuickCheck 2.9 (released 2016-07-10)
* Arbitrary, CoArbitrary and Function instances for more types
* Generics for automatic Function instances
* A new combinator "again" which undoes the effect of "once"
* Remove "exhaustive" from Testable typeclass;
instead, combinators which are nonexhaustive (such as forAll)
call "again", which should be more robust

* Drop support for GHC 6.x

* Fixed bugs:
* arbitrarySizedBoundedIntegral wasn't generating huge integers
* verboseCheck failed with Test.QuickCheck.Function
* label had a space leak

QuickCheck 2.8.2 (released 2016-01-15)
* GHC 8 support
* Add Arbitrary and CoArbitrary instances for types in
containers package
* Improve speed of shuffle combinator
* Only print to stderr if it's a terminal.
* Small changes: slightly improve documentation,
remove redundant constraints from some functions' types,
small improvements to Test.QuickCheck.All.

QuickCheck 2.8.1 (released 2015-04-03)
* Fix bug where exceptions thrown printing counterexamples weren't
being caught when terminal output was disabled
* Don't export Test.QuickCheck.Property.result

QuickCheck 2.8 (released 2015-03-18)
* New features:
* Support for GHC 7.10
* Arbitrary instance for Natural
* New generators shuffle and sublistOf
* Support for generic coarbitrary
* When using the cover combinator, insufficient coverage now
causes the property to fail

* API changes:
* Test.QuickCheck.Function: new pattern synonym Fn
* genericShrink no longer requires Typeable
* Result has a new constructor InsufficientCoverage
* resize throws an error if the size is negative

* Bug fixes:
* Fix memory leaks
* Exceptions thrown by callbacks now cause the test to fail
* Fixed a bug where the cover combinator wouldn't give a
warning if coverage was 0%

QuickCheck 2.7.3 (released 2014-03-24)
* Add annotations for Safe Haskell.

QuickCheck 2.7.2 (released 2014-03-22)
* Fix bug in cabal file which broke cabal test

QuickCheck 2.7.1 (released 2014-03-20)
* Fixed bug - the Small modifier didn't work on unsigned types
* Changed arbitrarySizedIntegral to have an Integral constraint
instead of just Num

QuickCheck 2.7 (released 2014-03-19)

* New features:
* New genericShrink function provides generic shrinking with GHC.
* New combinator x === y: fails if x /= y, but also prints their values
* New function generate :: Gen a -> IO a for running a generator.
* New combinators infiniteList and infiniteListOf for generating infinite lists.
* Several combinators added to the main Test.QuickCheck module which
were previously languishing in other modules. Of particular interest:
quickCheckAll, ioProperty.
* New combinators delay and capture which can be used (unsafely!)
to reuse the random number seed. Useful for generating
polymorphic (rank-2) values.
* A new Discard data type and a Testable instance for discarding test cases.
* All modifiers now have Functor instances and accessor functions.
* Pressing ctrl-C during shrinking now shows the last failed
test case, rather than the current shrinking candidate.
* Experimental support for UHC. You will need the latest version of Cabal from git.

* Better distribution of test data:
* The Int generator now only generates fairly small numbers.
* The new Small and Large modifiers control the distribution of integers
(Small generates small numbers, Large from the whole range).
* Floating-point numbers shrink better.

* Improved random number generation:
* QuickCheck now uses TFGen rather than StdGen on newer versions
of GHC, because StdGen's random numbers aren't always random.
* 'variant' now uses a prefix code. This should prevent some
potential bananaskins with coarbitrary.

* API changes:
* The Gen monad now uses an abstract type QCGen rather than StdGen.
* The Result type now returns the thrown exception and number
of failed shrink attempts.
* Property is now a newtype rather than Gen Prop as it was before.
* promote is moved into the new module Test.QuickCheck.Gen.Unsafe.
* 'printTestCase' is deprecated - its new name is 'counterexample'
* 'morallyDubiousIOProperty' is deprecated - its new name is
'ioProperty', no moral judgement involved :)

QuickCheck 2.6, released 2013-03-07

* Add convenience Function instances for up to 7-tuples
* Make stderr line buffered to reduce console I/O.
* Return a flag to say whether the test case was interrupted.

QuickCheck 2.5, released 2012-06-18

* Replace maxDiscard with maxDiscardRatio
* Remove Testable () instance.
* Added a 'discard' exception that discards the current test case
* Add accessors for modifiers (where it makes sense)
* Rename 'stop' to 'abort' to avoid a name clash
* Added a 'once' combinator
* If a property is of type Bool, only run it once
* Add coarbitraryEnum to Test.QuickCheck module.
* Add 'coarbitrary' helper for Enums.
* Rejiggled the formatting code to support multi-line error messages
* Add instances for Ordering and Fixed.
* Added arbitraryBoundedEnum generator (thanks to Antoine Latter).
* Add verboseCheckAll and polyverboseCheck function for usability.
comments powered byDisqus