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.
This commit is contained in:
parent
4fe499d3f2
commit
06eb9cfb34
3 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue