summaryrefslogtreecommitdiff
path: root/pandoc-lua-engine/test/Tests/Lua
diff options
context:
space:
mode:
Diffstat (limited to 'pandoc-lua-engine/test/Tests/Lua')
-rw-r--r--pandoc-lua-engine/test/Tests/Lua/Writer.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/pandoc-lua-engine/test/Tests/Lua/Writer.hs b/pandoc-lua-engine/test/Tests/Lua/Writer.hs
index c9a0d478c..97d772bc5 100644
--- a/pandoc-lua-engine/test/Tests/Lua/Writer.hs
+++ b/pandoc-lua-engine/test/Tests/Lua/Writer.hs
@@ -11,6 +11,7 @@ Tests for custom Lua writers.
module Tests.Lua.Writer (tests) where
import Data.Default (Default (def))
+import Data.Maybe (fromMaybe)
import Text.Pandoc.Class (runIOorExplode, readFileStrict)
import Text.Pandoc.Extensions (Extension (..))
import Text.Pandoc.Format (ExtensionsDiff (..), FlavoredFormat (..),
@@ -59,13 +60,8 @@ tests =
, goldenVsString "template"
"writer-template.out.txt"
(runIOorExplode $ do
- txt <- writeCustom "writer-template.lua" >>= \case
- (TextWriter f, _, mt) -> do
- template <- mt
- let opts = def{ writerTemplate = Just template }
- f opts (B.doc (B.plain (B.str "body goes here")))
- _ -> error "Expected a text writer"
- pure $ BL.fromStrict (UTF8.fromText txt))
+ (_, _, template) <- writeCustom "writer-template.lua"
+ pure . BL.fromStrict . UTF8.fromText $ fromMaybe "" template)
, testCase "preset extensions" $ do
let ediff = ExtensionsDiff{extsToEnable = [], extsToDisable = []}