hpack
hpack copied to clipboard
Add doctest example
Setup
- Create directory
test. - Create file
test/Doctest.hs:
Test.DocTest
main :: IO ()
main = doctest ["-isrc", "src/Main.hs", "src/MyModule.hs"]
- Add to
package.yaml:
tests:
doctest:
main: Doctests.hs
source-dirs:
- test
dependencies:
- doctest
Execution
- execute
hpackin project root directory. - run doctests with
stack testin root directory.