summaryrefslogtreecommitdiff
path: root/tests/TestSuite
diff options
context:
space:
mode:
authorBergi <a.d.bergi@web.de>2018-03-20 12:57:58 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2018-03-20 07:57:58 -0400
commitc28428fd8c61cfd21adba5b5fbefc0f8a1784da8 (patch)
tree35b65d133801b4e6fed8effd2286628d16f8a6ee /tests/TestSuite
parent9a23bfb129ca799cdeb9e893dcc82afbff742fb3 (diff)
downloadhakyll-c28428fd8c61cfd21adba5b5fbefc0f8a1784da8.tar.gz
Make Pandoc dependency optional
Diffstat (limited to 'tests/TestSuite')
-rw-r--r--tests/TestSuite/Util.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/TestSuite/Util.hs b/tests/TestSuite/Util.hs
index 33b26ef..fa411f8 100644
--- a/tests/TestSuite/Util.hs
+++ b/tests/TestSuite/Util.hs
@@ -8,6 +8,7 @@ module TestSuite.Util
, testCompilerDone
, testConfiguration
, cleanTestEnv
+ , renderParagraphs
) where
@@ -29,6 +30,7 @@ import Hakyll.Core.Provider
import Hakyll.Core.Store (Store)
import qualified Hakyll.Core.Store as Store
import Hakyll.Core.Util.File
+import Hakyll.Core.Item
--------------------------------------------------------------------------------
@@ -102,3 +104,13 @@ cleanTestEnv = do
removeDirectory $ destinationDirectory testConfiguration
removeDirectory $ storeDirectory testConfiguration
removeDirectory $ tmpDirectory testConfiguration
+
+
+--------------------------------------------------------------------------------
+-- | like 'Hakyll.Web.Pandoc.renderPandoc'
+-- | but allowing to test without the @usePandoc@ flag
+renderParagraphs :: Item String -> Compiler (Item String)
+renderParagraphs = withItemBody (return
+ . intercalate "\n" -- no trailing line
+ . map (("<p>"++) . (++"</p>"))
+ . lines)