All Projects → hedgehogqa → Haskell Hedgehog

hedgehogqa / Haskell Hedgehog

Release with confidence, state-of-the-art property testing for Haskell.

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Haskell Hedgehog

Fsharp Hedgehog
Release with confidence, state-of-the-art property testing for .NET.
Stars: ✭ 219 (-62.5%)
Mutual labels:  test, testing-tools, property-based-testing, quickcheck
puppeteer-screenshot-tester
Small library that allows us to compare screenshots generated by puppeteer in our tests.
Stars: ✭ 50 (-91.44%)
Mutual labels:  test, testing-tools
fixture-monkey
Let Fixture Monkey generate test instances including edge cases automatically
Stars: ✭ 177 (-69.69%)
Mutual labels:  test, property-based-testing
Vue Testing Library
🦎 Simple and complete Vue.js testing utilities that encourage good testing practices.
Stars: ✭ 567 (-2.91%)
Mutual labels:  test, testing-tools
edd
Erlang Declarative Debugger
Stars: ✭ 20 (-96.58%)
Mutual labels:  quickcheck, property-based-testing
gmock-xcode
Xcode integration for GoogleMock through XCTest
Stars: ✭ 18 (-96.92%)
Mutual labels:  test, testing-tools
Jqf
JQF + Zest: Coverage-guided semantic fuzzing for Java.
Stars: ✭ 340 (-41.78%)
Mutual labels:  property-based-testing, quickcheck
Wasmite
Now WebAssembly has proper testing, unit-testing and debugging 🤗
Stars: ✭ 20 (-96.58%)
Mutual labels:  test, testing-tools
Testfx
MSTest V2 framework and adapter
Stars: ✭ 391 (-33.05%)
Mutual labels:  test, testing-tools
Tparse
CLI tool for analyzing and summarizing go test output. Pipe friendly. CI/CD friendly.
Stars: ✭ 445 (-23.8%)
Mutual labels:  test, testing-tools
Mocha
☕️ simple, flexible, fun javascript test framework for node.js & the browser
Stars: ✭ 20,986 (+3493.49%)
Mutual labels:  test, testing-tools
kotest-gradle-plugin
A gradle plugin for Kotest
Stars: ✭ 18 (-96.92%)
Mutual labels:  test, testing-tools
hypothesis-gufunc
Extension to hypothesis for testing numpy general universal functions
Stars: ✭ 32 (-94.52%)
Mutual labels:  property-based-testing, testing-tools
leancheck
enumerative property-based testing for Haskell
Stars: ✭ 38 (-93.49%)
Mutual labels:  property-based-testing, testing-tools
carina-demo
Carina demo project.
Stars: ✭ 40 (-93.15%)
Mutual labels:  test, testing-tools
Kotest
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing
Stars: ✭ 3,234 (+453.77%)
Mutual labels:  test, testing-tools
Httptest
Qiniu httptest utilities
Stars: ✭ 571 (-2.23%)
Mutual labels:  test, testing-tools
qiniutest
Qiniu httptest tool: qiniutest
Stars: ✭ 36 (-93.84%)
Mutual labels:  test, testing-tools
pbt-frameworks
An overview of property-based testing functionality
Stars: ✭ 29 (-95.03%)
Mutual labels:  quickcheck, property-based-testing
Zora
Lightest, yet Fastest Javascript test runner for nodejs and browsers
Stars: ✭ 356 (-39.04%)
Mutual labels:  test, testing-tools

Release with confidence.

Hackage Travis AppVeyor

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.


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].