hpack icon indicating copy to clipboard operation
hpack copied to clipboard

Add doctest example

Open benjaminweb opened this issue 7 years ago • 0 comments

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 hpack in project root directory.
  • run doctests with stack test in root directory.

benjaminweb avatar Jun 04 '18 08:06 benjaminweb