Safe Haskell | None |
---|---|
Language | Haskell2010 |
Interpreters
Synopsis
- ignoringIOErrors :: IO () -> IO ()
- interpretTestIn' :: Member (Embed IO) r => Path Abs Dir -> InterpreterFor Test r
- interpretTest :: Member (Embed IO) r => Path Abs Dir -> InterpreterFor Test r
- interpretTestInSubdir :: Member (Embed IO) r => Text -> InterpreterFor Test r
- type TestEffects = [Error TestError, Embed IO, Hedgehog, Embed (TestT IO), Final (TestT IO)]
- errorToFailure :: Member (Embed (TestT IO)) r => Either TestError a -> Sem r a
- runTestIO :: Sem TestEffects a -> TestT IO a
- runTest :: Path Abs Dir -> Sem (Test ': TestEffects) a -> TestT IO a
- runTestInSubdir :: Text -> Sem (Test ': TestEffects) a -> TestT IO a
- callingTestDir :: Members [Error TestError, Embed IO] r => HasCallStack => Sem r (Path Abs Dir)
- runTestAuto :: HasCallStack => Sem (Test ': TestEffects) a -> TestT IO a
Documentation
ignoringIOErrors :: IO () -> IO () Source #
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 #
runTestIO :: Sem TestEffects a -> TestT IO a Source #
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
.