hw-polysemy 0.3.0.1 → 0.3.0.2
raw patch · 6 files changed
+75/−4 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hedgehog/HaskellWorks/Polysemy/Hedgehog.hs +7/−1
- hedgehog/HaskellWorks/Polysemy/Hedgehog/Effect/Hedgehog.hs +33/−0
- hedgehog/HaskellWorks/Polysemy/Hedgehog/Gen.hs +5/−0
- hedgehog/HaskellWorks/Polysemy/Hedgehog/Property.hs +20/−2
- hedgehog/HaskellWorks/Polysemy/Hedgehog/Range.hs +5/−0
- hw-polysemy.cabal +5/−1
hedgehog/HaskellWorks/Polysemy/Hedgehog.hs view
@@ -1,6 +1,7 @@ module HaskellWorks.Polysemy.Hedgehog- ( propertyOnce,+ ( property,+ propertyOnce, Hedgehog, @@ -26,8 +27,10 @@ trapFailJsonPretty, trapFailYaml, + success, failure, failMessage,+ assert, (===), byDeadlineIO,@@ -43,6 +46,9 @@ failWithCustom, evalIO_, evalM_,++ classify,+ forAll, catchAssertion, throwAssertion,
hedgehog/HaskellWorks/Polysemy/Hedgehog/Effect/Hedgehog.hs view
@@ -4,6 +4,7 @@ module HaskellWorks.Polysemy.Hedgehog.Effect.Hedgehog ( Hedgehog, + assert, assertEquals, catchAssertion, eval,@@ -15,6 +16,10 @@ throwAssertion, trapAssertion, + forAll,+ classify,+ success,+ hedgehogToMonadTestFinal, hedgehogToPropertyFinal, hedgehogToTestFinal,@@ -36,6 +41,10 @@ import Polysemy.Final data Hedgehog m rv where+ Assert :: HasCallStack+ => Bool+ -> Hedgehog m ()+ AssertEquals :: (HasCallStack, Eq a, Show a) => a -> a@@ -46,6 +55,11 @@ -> (H.Failure -> m a) -> Hedgehog m a + Classify :: HasCallStack+ => H.LabelName+ -> Bool+ -> Hedgehog m ()+ Eval :: HasCallStack => a -> Hedgehog m a@@ -95,6 +109,8 @@ => Sem (Hedgehog ': r) a -> Sem r a hedgehogToMonadTestFinal = interpretFinal \case+ Assert t ->+ liftS $ H.assert t AssertEquals a b -> liftS $ a H.=== b CatchAssertion f h -> do@@ -103,6 +119,8 @@ h' <- bindS h pure $ I.catchAssertion f' $ \e -> do h' (e <$ s)+ Classify labelName b ->+ liftS $ H.classify labelName b Eval a -> liftS $ H.eval a EvalIO f ->@@ -138,3 +156,18 @@ -> Sem r a catchExToPropertyFinal = catchExToFinal {-# INLINE catchExToPropertyFinal #-}++forAll :: forall a r. ()+ => Member (Embed (H.PropertyT IO)) r+ => Member Hedgehog r+ => Show a+ => H.Gen a+ -> Sem r a+forAll =+ embed . H.forAll++success :: forall r. ()+ => Member Hedgehog r+ => Sem r ()+success =+ pure ()
+ hedgehog/HaskellWorks/Polysemy/Hedgehog/Gen.hs view
@@ -0,0 +1,5 @@+module HaskellWorks.Polysemy.Hedgehog.Gen+ ( module G+ ) where++import Hedgehog.Gen as G
hedgehog/HaskellWorks/Polysemy/Hedgehog/Property.hs view
@@ -1,5 +1,6 @@ module HaskellWorks.Polysemy.Hedgehog.Property ( Property,+ property, propertyOnce, ) where @@ -19,7 +20,7 @@ import Polysemy.Resource import Polysemy.Time.Interpreter.Ghc -propertyOnce :: ()+property :: () => Sem [ Log , DataLog (LogEntry LogMessage)@@ -32,7 +33,7 @@ , Final (H.PropertyT IO) ] () -> H.Property-propertyOnce f =+property f = f & interpretLogDataLog & setLogLevelFromEnv "LOG_LEVEL" Info & interpretDataLogHedgehog formatLogEntry getLogEntryCallStack@@ -44,4 +45,21 @@ & runResource & runFinal & H.property+ & H.withTests 1++propertyOnce :: ()+ => Sem+ [ Log+ , DataLog (LogEntry LogMessage)+ , DataLog Text+ , GhcTime+ , Hedgehog+ , Embed IO+ , Embed (H.PropertyT IO)+ , Resource+ , Final (H.PropertyT IO)+ ] ()+ -> H.Property+propertyOnce f =+ f & property & H.withTests 1
+ hedgehog/HaskellWorks/Polysemy/Hedgehog/Range.hs view
@@ -0,0 +1,5 @@+module HaskellWorks.Polysemy.Hedgehog.Range+ ( module R+ ) where++import Hedgehog.Range as R
hw-polysemy.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.4 name: hw-polysemy-version: 0.3.0.1+version: 0.3.0.2 synopsis: Opinionated polysemy library description: Opinionated polysemy library. license: Apache-2.0@@ -201,11 +201,13 @@ HaskellWorks.Polysemy.Hedgehog.Effect.Hedgehog.Internal HaskellWorks.Polysemy.Hedgehog.Effect.Log HaskellWorks.Polysemy.Hedgehog.Eval+ HaskellWorks.Polysemy.Hedgehog.Gen HaskellWorks.Polysemy.Hedgehog.Golden HaskellWorks.Polysemy.Hedgehog.Jot HaskellWorks.Polysemy.Hedgehog.Process HaskellWorks.Polysemy.Hedgehog.Process.Internal HaskellWorks.Polysemy.Hedgehog.Property+ HaskellWorks.Polysemy.Hedgehog.Range HaskellWorks.Polysemy.Hedgehog.Test HaskellWorks.Polysemy.Hedgehog.Time HaskellWorks.Polysemy.Hedgehog.Ulid@@ -289,11 +291,13 @@ HaskellWorks.Polysemy.Hedgehog.Effect.Hedgehog.Internal, HaskellWorks.Polysemy.Hedgehog.Effect.Log, HaskellWorks.Polysemy.Hedgehog.Eval,+ HaskellWorks.Polysemy.Hedgehog.Gen, HaskellWorks.Polysemy.Hedgehog.Golden, HaskellWorks.Polysemy.Hedgehog.Jot, HaskellWorks.Polysemy.Hedgehog.Process, HaskellWorks.Polysemy.Hedgehog.Process.Internal, HaskellWorks.Polysemy.Hedgehog.Property,+ HaskellWorks.Polysemy.Hedgehog.Range, HaskellWorks.Polysemy.Hedgehog.Test, HaskellWorks.Polysemy.Hedgehog.Workspace, HaskellWorks.Polysemy.Prelude,