LeanCheck support for the Hspec test framework. https://github.com/rudymatela/hspec-leancheck#readme
|Version on this page:||0.0.3|
|Stackage Nightly 2018-12-10:||0.0.3|
|Latest on Hackage:||0.0.3|
Module documentation for 0.0.3
There are no documented modules for this package.
hspec-leancheck: LeanCheck support for Hspec
$ 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 sort is idempotent is identity FAILED  Failures: eg/minimal.hs:17:5: 1) sort is identity [1,0] To rerun use: --match "/sort/is identity/" Randomized with seed 44182769 Finished in 0.0008 seconds 2 examples, 1 failure
propertyWith to configure the number of tests.
Changelog for hspec-leancheck
- export the
- export the
- improvements in Haddock documentation;
- improve tests of
- add this changelog.
- improvements in documentation.
1st release on Hackage