aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Man.hs
blob: a9fe324d18bf7d308392a804f8adaf0d83d889ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.Man (tests) where

import Prelude
import Data.Text (Text)
import Test.Tasty
import Tests.Helpers
import Text.Pandoc
import Text.Pandoc.Arbitrary ()
import Text.Pandoc.Builder
import Text.Pandoc.Readers.Man

man :: Text -> Pandoc
man = purely $ readMan def

infix 4 =:
(=:) :: ToString c
     => String -> (Text, c) -> TestTree
(=:) = test man

tests :: [TestTree]
tests = [
  -- .SH "HEllo bbb" "aaa"" as"
  testGroup "Macros" [
          "Bold" =:
          ".B foo\n"
          =?> (para $ strong "foo")
        , "Italic" =:
          ".I foo\n"
          =?> (para $ emph "foo")
        ]
  ]