Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Hedgehog :: Effect where
- liftH :: forall a r. Member Hedgehog r => TestT IO a -> Sem r a
- assert :: forall r. Member Hedgehog r => Bool -> Sem r ()
- assertEqual :: forall a r. Eq a => Show a => Member Hedgehog r => a -> a -> Sem r ()
- (===) :: Eq a => Show a => Member Hedgehog r => a -> a -> Sem r ()
- evalEither :: forall a e r. Show e => Member Hedgehog r => Either e a -> Sem r a
- assertRight :: forall a e r. Show e => Eq a => Show a => Member Hedgehog r => a -> Either e a -> Sem r ()
Documentation
data Hedgehog :: Effect where Source #
Convenience effect for embedding Hedgehog assertions.
LiftH :: TestT IO a -> Hedgehog m a | |
Assert :: Bool -> Hedgehog m () | |
AssertEqual :: (Eq a, Show a) => a -> a -> Hedgehog m () | |
EvalEither :: Show e => Either e a -> Hedgehog m a | |
AssertRight :: (Show e, Eq a, Show a) => a -> Either e a -> Hedgehog m () |
Instances
type DefiningModule Hedgehog Source # | |
Defined in Polysemy.Test.Data.Hedgehog type DefiningModule Hedgehog = "Polysemy.Test.Data.Hedgehog" |
liftH :: forall a r. Member Hedgehog r => TestT IO a -> Sem r a Source #
Lift a
into Sem.
>>> liftH (Hedgehog.evalEither (Right 0))TestT
IO
assertEqual :: forall a r. Eq a => Show a => Member Hedgehog r => a -> a -> Sem r () Source #
Embeds 'Hedgehog.(===)'.
(===) :: Eq a => Show a => Member Hedgehog r => a -> a -> Sem r () Source #
Alias for assertEqual
.
>>> 5 === 6
evalEither :: forall a e r. Show e => Member Hedgehog r => Either e a -> Sem r a Source #
Embeds evalEither
.
assertRight :: forall a e r. Show e => Eq a => Show a => Member Hedgehog r => a -> Either e a -> Sem r () Source #
Given a reference value, unpacks an Either
with evalEither
and applies assertEqual
to the result in the
Right
case, and produces a test failure in the Left
case.