From 4a2ad11155014bcf13a7dbd7f6b9e2c530ac3b79 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 16 Aug 2022 12:24:49 +1000 Subject: Adding initial test for the org backend. --- org-test/Main.hs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 org-test/Main.hs (limited to 'org-test/Main.hs') diff --git a/org-test/Main.hs b/org-test/Main.hs new file mode 100644 index 00000000..01658fd9 --- /dev/null +++ b/org-test/Main.hs @@ -0,0 +1,35 @@ +{-# LANGUAGE CPP #-} + + +import Data.Function +import System.Environment +import System.FilePath + +import Test.Haddock +import Test.Haddock.Utils + + +checkConfig :: CheckConfig String +checkConfig = CheckConfig + { ccfgRead = Just + , ccfgClean = const id + , ccfgDump = id + , ccfgEqual = (==) + } + + +dirConfig :: DirConfig +dirConfig = (defaultDirConfig $ takeDirectory __FILE__) + { dcfgCheckIgnore = checkIgnore + } + + +main :: IO () +main = do + cfg <- parseArgs checkConfig dirConfig =<< getArgs + runAndCheck $ cfg + { cfgHaddockArgs = cfgHaddockArgs cfg ++ ["--org"] + } + +checkIgnore :: FilePath -> Bool +checkIgnore file = takeExtension file /= ".org" -- cgit v1.2.3