From 06eb9cfb349ca6ccfde3d1938fcd13ddc65f5cb6 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 1 Dec 2016 15:39:54 -0500 Subject: Make Txt2Tags test pass. We don't have a good way to set things that aren't in the common state. That will be the next order of business. --- tests/Tests/Readers/Txt2Tags.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/Tests/Readers/Txt2Tags.hs b/tests/Tests/Readers/Txt2Tags.hs index 33502ba78..bef1d4965 100644 --- a/tests/Tests/Readers/Txt2Tags.hs +++ b/tests/Tests/Readers/Txt2Tags.hs @@ -4,16 +4,21 @@ module Tests.Readers.Txt2Tags (tests) where import Text.Pandoc.Definition import Test.Framework import Tests.Helpers +import Control.Monad.State import Text.Pandoc.Arbitrary() import Text.Pandoc.Builder import Text.Pandoc import Data.List (intersperse) -import Text.Pandoc.Readers.Txt2Tags +import Text.Pandoc.Class t2t :: String -> Pandoc -- t2t = handleError . readTxt2Tags (T2TMeta "date" "mtime" "in" "out") def -t2t = purely $ readTxt2Tags def +t2t = purely $ \s -> do + put def { stInputFiles = Just ["in"] + , stOutputFile = Just "out" + } + readTxt2Tags def s infix 4 =: (=:) :: ToString c @@ -80,10 +85,10 @@ tests = , "Macros: Date" =: "%%date" =?> - para "date" + para "1970-01-01" , "Macros: Mod Time" =: "%%mtime" =?> - para "mtime" + para "" , "Macros: Infile" =: "%%infile" =?> para "in" -- cgit v1.2.3