hedgehog alternatives and similar packages
Based on the "Testing" category.
Alternatively, view hedgehog alternatives based on common mentions on social networks and blogs.
-
quickcheck-state-machine
Test monadic programs using state machine based models -
curl-runnings
A declarative test framework for quickly and easily writing integration tests against JSON API's. -
smallcheck
Test your Haskell code by exhaustively checking its properties -
ghc-prof-flamegraph
Generates data to be used with flamegraph.pl from .prof files. -
monad-mock
A Haskell package that provides a monad transformer for mocking mtl-style typeclasses -
fuzzcheck
A library for testing monadic code in the spirit of QuickCheck -
test-framework
Framework for running and organising QuickCheck test properties and HUnit test cases -
tasty-hedgehog
Tasty integration for the Hedgehog property testing library -
hspec-expectations-json
Hspec expectations on JSON Values -
should-not-typecheck
A HUnit/hspec assertion to verify that an expression does not typecheck -
quickcheck-arbitrary-adt
Typeclass for generating a list of each instance of a sum type's constructors -
hspec-golden-aeson
Use tests to monitor changes in Aeson serialization -
test-framework-th
Automagically (using Template Haskell) generates the Haskell-code you need when using HUnit -
markov-chain-usage-model
Computations for Markov chain usage models -
tasty-expected-failure
Mark test cases as expected-failure -
test-framework-sandbox
test-sandbox support for the test-framework package -
tasty-rerun
Rerun previous test suite runs to run only failing tests
ONLYOFFICE Docs โ document collaboration in your environment
Do you think we are missing an alternative of hedgehog or a related project?
README
<!-- 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 -->
Release with confidence.
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
- Integrated shrinking, shrinks obey invariants by construction.
- Abstract state machine testing.
- Generators allow monadic effects.
- Range combinators for full control over the scope of generated numbers and collections.
- Equality and roundtrip assertions show a diff instead of the two inequal values.
- Template Haskell test runner which executes properties concurrently.
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.