diff options
author | Yuchen Pei <hi@ypei.me> | 2022-08-16 12:24:49 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-08-16 14:06:43 +1000 |
commit | ba880b4c29724768eec5a3c07c79d5525e8b7992 (patch) | |
tree | 2b99ac288bfffe78c88c97b6984f4cddf71a7421 /org-test/Main.hs | |
parent | 6b48872222cc21e864e637055d95c71ff911fddf (diff) |
Adding initial test for the org backend.
Diffstat (limited to 'org-test/Main.hs')
-rw-r--r-- | org-test/Main.hs | 35 |
1 files changed, 35 insertions, 0 deletions
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" |