hedgehog: Release with confidence.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Hedgehog automatically generates a comprehensive array of test cases, exercising your software in ways human testers would never imagine.

Generate hundreds of test cases automatically, exposing even the most insidious of corner cases. Failures are automatically simplified, giving developers coherent, intelligible error messages.

To get started quickly, see the examples.


[Skip to ReadMe]

Properties

Versions0.1, 0.2, 0.2.1, 0.2.2, 0.3, 0.4, 0.4.1, 0.5, 0.5.1, 0.5.2, 0.5.3, 0.6, 0.6.1, 1.0, 1.0, 1.0.1
Change logCHANGELOG.md
Dependenciesansi-terminal (>=0.6 && <0.10), async (>=2.0 && <2.3), base (>=4.9 && <5), bytestring (==0.10.*), concurrent-output (>=1.7 && <1.11), containers (>=0.4 && <0.7), directory (>=1.2 && <1.4), exceptions (>=0.7 && <0.11), fail (>=4.9 && <5), lifted-async (>=0.7 && <0.11), mmorph (>=1.0 && <1.2), monad-control (==1.0.*), mtl (>=2.1 && <2.3), pretty-show (>=1.6 && <1.10), primitive (==0.6.*), random (==1.1.*), resourcet (>=1.1 && <1.3), semigroups (>=0.16 && <0.19), stm (>=2.4 && <2.6), template-haskell (>=2.10 && <2.15), text (>=1.1 && <1.3), time (>=1.4 && <1.10), transformers (==0.5.*), transformers-base (>=0.4.5.1 && <0.5), wl-pprint-annotated (>=0.0 && <0.2) [details]
LicenseBSD-3-Clause
AuthorJacob Stanley
MaintainerJacob Stanley <jacob@stanley.io>
CategoryTesting
Home pagehttps://hedgehog.qa
Bug trackerhttps://github.com/hedgehogqa/haskell-hedgehog/issues
Source repositoryhead: git clone git://github.com/hedgehogqa/haskell-hedgehog.git
UploadedMon May 13 09:52:11 UTC 2019 by JacobStanley

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for hedgehog-1.0

[back to package description]
<!-- Apologies to those who are able to read this. Unfortunately, Hackage doesn't seem to render the HTML portion of the markdown spec so you may be better off paying us a visit on GitHub instead: https://github.com/hedgehogqa/haskell-hedgehog --> <div align="center">

<img width="400" src="https://github.com/hedgehogqa/haskell-hedgehog/raw/master/img/hedgehog-text-logo.png" />

Release with confidence.

Hackage Travis AppVeyor

<div align="left">

Hedgehog automatically generates a comprehensive array of test cases, exercising your software in ways human testers would never imagine.

Generate hundreds of test cases automatically, exposing even the most insidious of corner cases. Failures are automatically simplified, giving developers coherent, intelligible error messages.

Features

Example

The main module, Hedgehog, includes almost everything you need to get started writing property tests with Hedgehog.

It is designed to be used alongside Hedgehog.Gen and Hedgehog.Range which should be imported qualified. You also need to enable Template Haskell so the Hedgehog test runner can find your properties.

{-# LANGUAGE TemplateHaskell #-}

import           Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range

Once you have your imports set up, you can write a simple property:

prop_reverse :: Property
prop_reverse =
  property $ do
    xs <- forAll $ Gen.list (Range.linear 0 100) Gen.alpha
    reverse (reverse xs) === xs

And add the Template Haskell splice which will discover your properties:

tests :: IO Bool
tests =
  checkParallel $$(discover)

If you prefer to avoid macros, you can specify the group of properties to run manually instead:

{-# LANGUAGE OverloadedStrings #-}

tests :: IO Bool
tests =
  checkParallel $ Group "Test.Example" [
      ("prop_reverse", prop_reverse)
    ]

You can then load the module in GHCi, and run it:

λ tests
━━━ Test.Example ━━━
  ✓ prop_reverse passed 100 tests.

<div align="center"> <br /> <img width="307" src="https://github.com/hedgehogqa/haskell-hedgehog/raw/master/img/hedgehog-logo-grey.png" />