summaryrefslogtreecommitdiff
path: root/test/Tests/Command.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-01-31 20:56:20 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-01-31 20:56:20 -0800
commit7c424b315cb814b952d9bd9d5f027beb70169bff (patch)
tree95fc61980e1588da792832fa3d40c8f0d04863b5 /test/Tests/Command.hs
parentfdf7f07f6269238dacae7dc90068f64d4666367e (diff)
Tests: avoid calling findPandoc multiple times.
Diffstat (limited to 'test/Tests/Command.hs')
-rw-r--r--test/Tests/Command.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs
index 89ea9a741..eeb43604a 100644
--- a/test/Tests/Command.hs
+++ b/test/Tests/Command.hs
@@ -53,13 +53,12 @@ runTest testname pandocpath cmd inp norm = testCase testname $ do
return $ TestError ec
assertBool (show result) (result == TestPassed)
-tests :: TestTree
+tests :: FilePath -> TestTree
{-# NOINLINE tests #-}
-tests = unsafePerformIO $ do
- pandocpath <- findPandoc
+tests pandocPath = unsafePerformIO $ do
files <- filter (".md" `isSuffixOf`) <$>
getDirectoryContents "command"
- let cmds = map (extractCommandTest pandocpath) files
+ let cmds = map (extractCommandTest pandocPath) files
return $ testGroup "Command:" cmds
isCodeBlock :: Block -> Bool