polysemy-test 0.6.0.0 → 0.7.0.0
raw patch · 5 files changed
+34/−15 lines, 5 filesdep ~incipit-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: incipit-core
API changes (from Hackage documentation)
+ Polysemy.Test: unitTestTimes :: TestLimit -> TestName -> UnitTest -> TestTree
Files
- changelog.md +7/−0
- lib/Polysemy/Test.hs +16/−5
- lib/Polysemy/Test/Hedgehog.hs +0/−1
- polysemy-test.cabal +10/−6
- test/Polysemy/Test/Test/FilesTest.hs +1/−3
changelog.md view
@@ -1,3 +1,10 @@+# Unreleased++# 0.7.0.0++* Add `unitTestTimes`, converting `UnitTest` to `TestTree` with a specified number of test runs.+* Support GHC 9.4.+ # 0.6.0.0 * Expose the `Error Failure` effect in the hedgehog interpret stack to allow throwing `Failure` manually.
lib/Polysemy/Test.hs view
@@ -43,18 +43,19 @@ -- * Utilities UnitTest, unitTest,+ unitTestTimes, TestError(TestError), ) where import qualified Data.Text as Text-import Hedgehog (TestT, property, test, withTests)+import Hedgehog (TestLimit, TestT, property, test, withTests) import Path (File, Path, Rel) import Test.Tasty (TestName, TestTree) import Test.Tasty.Hedgehog (testProperty) import Polysemy.Test.Data.Hedgehog (Hedgehog, liftH) import Polysemy.Test.Data.Test (Test, fixture, fixturePath, tempDir, tempFile, tempFileContent, testDir)-import Polysemy.Test.Data.TestError (TestError(TestError))+import Polysemy.Test.Data.TestError (TestError (TestError)) import Polysemy.Test.Hedgehog ( assert, assertClose,@@ -91,13 +92,23 @@ type UnitTest = TestT IO () -- |Convert a @'TestT' IO ()@ to a 'TestTree' ready for use with Tasty's machinery.--- This is for non-property tests.+-- This is for non-property tests that are supposed to be executed @n@ times.+unitTestTimes ::+ TestLimit ->+ TestName ->+ UnitTest ->+ TestTree+unitTestTimes n desc =+ testProperty desc . withTests n . property . test++-- |Convert a @'TestT' IO ()@ to a 'TestTree' ready for use with Tasty's machinery.+-- This is for non-property tests that are supposed to be executed once. unitTest :: TestName -> UnitTest -> TestTree-unitTest desc =- testProperty desc . withTests 1 . property . test+unitTest =+ unitTestTimes 1 -- |Read the contents of a file relative to the fixture directory as a list of lines. fixtureLines ::
lib/Polysemy/Test/Hedgehog.hs view
@@ -5,7 +5,6 @@ import Control.Monad.Trans.Except (runExceptT) import qualified Control.Monad.Trans.Writer.Lazy as MTL-import GHC.Stack (withFrozenCallStack) import qualified Hedgehog as Native import Hedgehog.Internal.Property (Failure, Journal, TestT (TestT), failWith)
polysemy-test.cabal view
@@ -1,11 +1,11 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.34.6.+-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack name: polysemy-test-version: 0.6.0.0+version: 0.7.0.0 synopsis: Polysemy Effects for Testing description: See https://hackage.haskell.org/package/polysemy-test/docs/Polysemy-Test.html category: Test@@ -59,6 +59,7 @@ DisambiguateRecordFields DoAndIfThenElse DuplicateRecordFields+ EmptyCase EmptyDataDecls ExistentialQuantification FlexibleContexts@@ -73,8 +74,9 @@ MultiParamTypeClasses MultiWayIf NamedFieldPuns- OverloadedStrings+ OverloadedLabels OverloadedLists+ OverloadedStrings PackageImports PartialTypeSignatures PatternGuards@@ -102,7 +104,7 @@ build-depends: base >=4.12 && <5 , hedgehog >=1.0.2- , incipit-core >=0.3+ , incipit-core >=0.4 , path >=0.7 , path-io >=0.2 , polysemy >=1.3@@ -144,6 +146,7 @@ DisambiguateRecordFields DoAndIfThenElse DuplicateRecordFields+ EmptyCase EmptyDataDecls ExistentialQuantification FlexibleContexts@@ -158,8 +161,9 @@ MultiParamTypeClasses MultiWayIf NamedFieldPuns- OverloadedStrings+ OverloadedLabels OverloadedLists+ OverloadedStrings PackageImports PartialTypeSignatures PatternGuards@@ -187,7 +191,7 @@ build-depends: base >=4.12 && <5 , hedgehog >=1.0.2- , incipit-core >=0.3+ , incipit-core >=0.4 , path >=0.7 , polysemy >=1.3 , polysemy-test
test/Polysemy/Test/Test/FilesTest.hs view
@@ -1,10 +1,8 @@-{-# options_ghc -Wno-unused-imports #-}- module Polysemy.Test.Test.FilesTest where import qualified Data.Text as Text import qualified Data.Text.IO as Text-import Path (File, Rel, relfile, toFilePath)+import Path (relfile, toFilePath) import Polysemy.Test (UnitTest, fixtureLines, runTestAuto, runTestInSubdir, tempFileLines, (/==), (===)) import qualified Polysemy.Test.Data.Test as Test