aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal3
-rw-r--r--src/Text/Pandoc/Class.hs1
-rw-r--r--tests/Tests/Readers/Txt2Tags.hs13
3 files changed, 12 insertions, 5 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index ef253f79a..dbd0a4d1c 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -518,7 +518,8 @@ Test-Suite test-pandoc
containers >= 0.1 && < 0.6,
ansi-terminal >= 0.5 && < 0.7,
executable-path >= 0.0 && < 0.1,
- zip-archive >= 0.2.3.4 && < 0.4
+ zip-archive >= 0.2.3.4 && < 0.4,
+ mtl >= 2.2 && < 2.3
Other-Modules: Tests.Old
Tests.Helpers
Tests.Shared
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index a888861b8..49c2b788e 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -32,6 +32,7 @@ Typeclass for pandoc readers and writers, allowing both IO and pure instances.
-}
module Text.Pandoc.Class ( PandocMonad(..)
+ , CommonState(..)
, PureState(..)
, PureEnv(..)
, getPOSIXTime
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"