polysemy-test-0.1.0.0: Polysemy effects for testing
Safe HaskellNone
LanguageHaskell2010

Polysemy.Test.Run

Description

Interpreters

Synopsis

Documentation

interpretTestIn' :: Member (Embed IO) r => Path Abs Dir -> InterpreterFor Test r Source #

interpretTest :: Member (Embed IO) r => Path Abs Dir -> InterpreterFor Test r Source #

Interpret Test so that all file system operations are performed in the directory base. The temp directory will be removed before running.

This library uses Path for all file system related tasks, so in order to construct paths manually, you'll have to use the quasiquoters absdir and reldir or the functions parseAbsDir and parseRelDir.

interpretTestInSubdir :: Member (Embed IO) r => Text -> InterpreterFor Test r Source #

Call interpretTestIn with the subdirectory prefix of the current working directory as the base dir, which is most likely something like test. This is not necessarily consistent, it depends on which directory your test runner uses as cwd.

type TestEffects = [Error TestError, Embed IO, Hedgehog, Embed (TestT IO), Final (TestT IO)] Source #

errorToFailure :: Member (Embed (TestT IO)) r => Either TestError a -> Sem r a Source #

runTestIO :: Sem TestEffects a -> TestT IO a Source #

runTest :: Path Abs Dir -> Sem (Test ': TestEffects) a -> TestT IO a Source #

Convenience combinator that runs both Hedgehog and Test and uses the final monad TestT IO, ready for execution as a property.

runTestInSubdir :: Text -> Sem (Test ': TestEffects) a -> TestT IO a Source #

Same as runTest, but uses interpretTestInSubdir.

callingTestDir :: Members [Error TestError, Embed IO] r => HasCallStack => Sem r (Path Abs Dir) Source #

runTestAuto :: HasCallStack => Sem (Test ': TestEffects) a -> TestT IO a Source #

Wrapper for runTest that uses the call stack to determine the base dir of the test run. Note that if you wrap this function, you'll have to use the HasCallStack constraint to supply the implicit CallStack.