A synonym for easy migration from hspec
Modulesydtest-0.22.0.0Haskell2010
Test.Syd.Def.TestDefM
- 6 types
- 4 values
- Packagesydtest-0.22.0.0
- Exports10
- LanguageHaskell2010
- LicenceLicenseRef-OtherLicense
- SourceTestDefM.hs
A synonym for easy migration from hspec
A synonym for easy migration from hspec
A synonym for a test suite definition
The test definition monad
This type has three parameters:
outers: A type-level list of the outer resources. These are resources that are prived once, around a group of tests. (This is the type of the results ofaroundAll.)inner: The inner resource. This is a resource that is set up around every test, and even every example of a property test. (This is the type of the result ofaround.)result: The result (TestDefM is a monad.)
In practice, all of these three parameters should be () at the top level.
Constructors
TestDefMunTestDefM :: WriterT (TestForest outers inner) (ReaderT TestDefEnv IO) result
Instances6MonadReader, Monad, Functor, Applicative, MonadIO, MonadWriter
MonadReader TestDefEnv (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMMonad (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMFunctor (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMApplicative (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMMonadIO (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMMonadWriter (TestForest outers inner) (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefM
Constructors
Instances5Eq, Show, Generic, MonadReader, Rep
Eq TestDefEnvDefined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMShow TestDefEnvDefined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMGeneric TestDefEnvDefined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMMonadReader TestDefEnv (TestDefM outers inner)Defined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefMtype Rep TestDefEnv = D1 ('MetaDataDefined in sydtest-0.22.0.0 · Test.Syd.Def.TestDefM"TestDefEnv"
"Test.Syd.Def.TestDefM"
"sydtest-0.22.0.0-C6WVjaL6xelIJS238V3PZE"
'False) (C1 ('MetaCons"TestDefEnv"
'PrefixI 'True) (S1 ('MetaSel ('Just"testDefEnvDescriptionPath"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text]) :*: S1 ('MetaSel ('Just"testDefEnvTestRunSettings"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TestRunSettings)))
Get the path of describe strings upwards.
Note that using this function makes tests less movable, depending on what
you do with these strings.
For example, if you use these strings to define the path to a golden test
file, then that path will change if you move the tests somewhere else.
This combines unfortunately with the way sydtest-discover makes the module
name part of this path.
Indeed: moving your tests to another module will change their path as well,
if you use sydtest-discover.
Also note that while test forests can be randomised, their description path
upwards will not, because of how trees are structured.