hspec-leancheck: LeanCheck support for the Hspec test framework.

[ bsd3, library, testing ] [ Propose Tags ]

LeanCheck support for the Hspec test framework.

This package can be used to incorporate LeanCheck tests into Hspec test suites by means of the Test.Hspec.LeanCheck.testProperty function.

Please see the Haddock documentation and README for more details.

[Skip to Readme]
Versions [faq] 0.0.1, 0.0.2, 0.0.3
Change log changelog.md
Dependencies base (==4.*), hspec (>=2.5), hspec-core, HUnit, leancheck [details]
License BSD-3-Clause
Author Rudy Matela <rudy@matela.com.br>
Maintainer Rudy Matela <rudy@matela.com.br>
Category Testing
Home page https://github.com/rudymatela/hspec-leancheck#readme
Source repo head: git clone https://github.com/rudymatela/hspec-leancheck
this: git clone https://github.com/rudymatela/hspec-leancheck(tag v0.0.3)
Uploaded by rudymatela at Wed Nov 21 23:36:06 UTC 2018
Distributions LTSHaskell:0.0.3, NixOS:0.0.3, Stackage:0.0.3
Downloads 200 total (20 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for hspec-leancheck-0.0.3

[back to package description]

hspec-leancheck: LeanCheck support for Hspec

hspec-leancheck&#39;s Build Status hspec-leancheck on Hackage hspec-leancheck on Stackage LTS hspec-leancheck on Stackage Nightly

LeanCheck support for the Hspec test framework.


$ cabal install hspec-leancheck


Here's how your spec.hs might look like:

import Test.Hspec
import Test.Hspec.LeanCheck as LC

import Data.List (sort)

main :: IO ()
main = hspec spec

spec :: Spec
spec = do
  describe "sort" $ do
    it "is idempotent" $
      LC.property $ \xs -> sort (sort xs :: [Int]) == sort xs
    it "is identity" $ -- not really
      LC.property $ \xs -> sort (xs :: [Int]) == xs

And here is the output for the above program:

$ ./eg/minimal

  is idempotent
  is identity FAILED [1]


  1) sort is identity

  To rerun use: --match "/sort/is identity/"

Randomized with seed 44182769

Finished in 0.0008 seconds
2 examples, 1 failure


Use propertyWith to configure the number of tests.

Further reading