@hackage doctest-extract0.1.2
Alternative doctest implementation that extracts comments to modules
Categories
License
BSD-3-Clause
Maintainer
Henning Thielemann <haskell@henning-thielemann.de>
Links
Versions
Installation
Tested Compilers
Dependencies (0)
- base >=4.5 && <5
- doctest-lib >=0.0 && <0.2
- non-empty >=0.3.3 && <0.4
- optparse-applicative >=0.11 && <0.20
- pathtype >=0.8 && <0.9
- semigroups >=0.18.5 && <0.21 Show all…
Dependents (0)
Known Issues
-
For compatibility with original
doctestparser you cannot write{-# LANGUAGE MyPreferredExtension #-}Instead you must write
:set -XMyPreferredExtension -
In Literal Haskell files only
\\begin{code} ... \\end{code}blocks are scanned, but not bird style code blocks. -
prop>supports multi-line code, but both originaldoctestandhaddockdo not support it. -
IO tests are not supported as
doctestexamples, so far. We need a syntactic distinction for IO tests, becausedoctest-extractdoes not employ a type-checker. We could mark IO tests with a specificidfunction, as inioTest $ runMyTestor a type annotation, as inrunMyTest :: IO ().
Tipps and Tricks
How to disable selected tests?
For focussing on certain tests it can be useful to disable other ones.
We have not implemented a mechanism to disable parts of the test suite
in doctest-extract,
because this would require to implement a way to identify tests.
You can still disable some of the tests
without explicit support by doctest-extraxt.
-
If you want to disable whole modules, you may make a copy of the auto-generated
Test/Main.hsand remove the modules that you want to skip. -
For disabling all tests on a function you may turn a Haddock comment into a plain comment by removing the bar after the opening of the comment.
-
For disabling individual tests you may prefix
>>>andprop>with an asterisk or the like.
These tricks work best in conjunction with a revision control systen, such that it always reminds you that there are tests disabled temporarily.