summaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-12-01 15:39:54 -0500
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:40 +0100
commit06eb9cfb349ca6ccfde3d1938fcd13ddc65f5cb6 (patch)
treef32d078511443a5c00640e76258e4fcc1cab8224 /tests/Tests
parent4fe499d3f29c0ed6ffe23299ca581a11563f7c9d (diff)
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.
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Readers/Txt2Tags.hs13
1 files changed, 9 insertions, 4 deletions
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"