@@ -94,15 +94,12 @@ all the test suites before running `Prelude.Serial`.
95## Writing doctests
95## Writing doctests
97−* The test named `doctest` runs all the code snippets in a source module
97+* We use `cabal-docspec` to run all the code snippets in a source module
98− that are written using the `>>>` markup in haddock. See `doctest.hs`.
98+ that are written using the `>>>` markup in haddock.
99* Make sure you do not enclose your snippets in the `@ .. @` markup otherwise
99* Make sure you do not enclose your snippets in the `@ .. @` markup otherwise
100 they will show up verbatim in the docs and not as ghci styled snippets.
100 they will show up verbatim in the docs and not as ghci styled snippets.
101−* We use `--fast` mode of doctest, which means snippets are run as if you are
102− typing those examples from top to bottom in that order in GHCi. Previous
103− snippet's state is available to the next one.
104* A haddock section named `$setup` contains a snippet that is always run before
101* A haddock section named `$setup` contains a snippet that is always run before
105− any other. When `--fast` mode is not used it is run before every snippet.
102+ any other.
107An example setup section:
104An example setup section:
@@ -113,8 +110,8 @@ An example setup section:
113-- >>> import Data.Function ((&))
110-- >>> import Data.Function ((&))
116−Some tests that may take long can be written as follows. Just assigning
113+Some tests that may take long can be written as follows. Just defining
117−the code to a function makes it compile but not run.
114+the snippet as a function makes it compile but not run.
@@ -128,27 +125,11 @@ main = do
129## Running doctests
126## Running doctests
131−Run tests for all modules:
134−$ cabal run doctests --flag doctests
137−Use verbose mode to debug:
140−$ cabal run doctests --flag doctests -- --verbose
129+$ cabal build all
130+$ cabal-docspec --timeout 60 --check-properties --property-variables xs
143−Run tests only for selected modules:
146−$ cabal run doctests --flag doctests -- --modules Streamly.Prelude
149−If it fails with a message that a particular modules is not loaded specify that
150−module as well on the command line.
152## Naming of test modules
133## Naming of test modules
154Tests are organized by source modules. For example, for the source
135Tests are organized by source modules. For example, for the source