Copyright | (c) 2023 Nicolas Trangez |
---|---|
License | Apache-2.0 |
Maintainer | ikke@nicolast.be |
Stability | alpha |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Support code to check lawful-classes
laws using Hedgehog and, optionally,
Tasty.
Synopsis
- testLaws :: TestName -> (forall a. m a -> PropertyT IO a) -> Laws m -> TestTree
- testLawsWith :: (Property -> Property) -> TestName -> (forall a. m a -> PropertyT IO a) -> Laws m -> TestTree
- toProperty :: (forall a. m a -> PropertyT IO a) -> Law m -> Property
Tasty integration
testLaws :: TestName -> (forall a. m a -> PropertyT IO a) -> Laws m -> TestTree Source #
Given Laws
for m
and a way to evaluate an m a
in
,
create a PropertyT
IOtasty
TestTree
.
testLawsWith :: (Property -> Property) -> TestName -> (forall a. m a -> PropertyT IO a) -> Laws m -> TestTree Source #
Given Laws
for m
and a way to evaluate an m a
in
,
create a PropertyT
IOtasty
TestTree
, modifying all created Property
s with the
given function.
As an example, withTests
could be used to reduce or increase
the number of times tests are executed, e.g., because m
is not a
transformer so there's no way to generate multiple test exemplars using
some generator, except for the trivial constant generator.
Since: 0.1.1.0
Plumbing
toProperty :: (forall a. m a -> PropertyT IO a) -> Law m -> Property Source #
Given a way to evaluate an m a
into a base Monad
, turn a Law
into a Property
.