pandoc/test/Tests/Readers/Man.hs

33 lines
653 B
Haskell
Raw Normal View History

2018-02-25 03:34:17 +03:00
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.Man (tests) where
2018-05-09 20:40:37 +03:00
import Prelude
2018-02-25 03:34:17 +03:00
import Data.Text (Text)
import Test.Tasty
import Tests.Helpers
import Text.Pandoc
import Text.Pandoc.Arbitrary ()
import Text.Pandoc.Builder
2018-05-09 03:24:45 +03:00
import Text.Pandoc.Readers.Man
2018-02-25 03:34:17 +03:00
2018-05-09 03:24:45 +03:00
man :: Text -> Pandoc
man = purely $ readMan def
infix 4 =:
(=:) :: ToString c
=> String -> (Text, c) -> TestTree
(=:) = test man
2018-02-25 03:34:17 +03:00
tests :: [TestTree]
2018-05-09 03:24:45 +03:00
tests = [
-- .SH "HEllo bbb" "aaa"" as"
testGroup "Macros" [
"Bold" =:
".B foo\n"
2018-05-09 20:40:37 +03:00
=?> (para $ strong "foo")
2018-05-09 03:24:45 +03:00
, "Italic" =:
".I foo\n"
2018-05-09 20:40:37 +03:00
=?> (para $ emph "foo")
2018-05-09 03:24:45 +03:00
]
]