From 1a5bbbfcd32bc2c60f2be409fc12391a4c8898e0 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 16 Jul 2022 14:20:27 +0200 Subject: [PATCH] Add doc-test testsuite, fixing doc examples --- test/DocTestMain.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/DocTestMain.hs diff --git a/test/DocTestMain.hs b/test/DocTestMain.hs new file mode 100644 index 0000000..fdcb2f5 --- /dev/null +++ b/test/DocTestMain.hs @@ -0,0 +1,16 @@ +module Main where + +import System.Environment + ( getArgs ) +import Test.DocTest + ( mainFromLibrary ) +import Test.DocTest.Helpers + ( extractSpecificCabalLibrary, findCabalPackage ) + +main :: IO () +main = do + args <- getArgs + pkg <- findCabalPackage "regex-tdfa" + -- Need to give the library name, otherwise the parser does not find it. + lib <- extractSpecificCabalLibrary Nothing pkg + mainFromLibrary lib args