diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-04-14 10:38:21 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-04-14 10:42:05 -0700 |
commit | d5b98c8c6ec13556911876ac5632efb63a1ce40d (patch) | |
tree | 07b56109442090643dabc85e6023ffe3c1a7d93d /test/Tests/Writers/AsciiDoc.hs.orig | |
parent | 488320faac36bbe9add43f2947afe16444ab23a6 (diff) | |
download | pandoc-d5b98c8c6ec13556911876ac5632efb63a1ce40d.tar.gz |
Man writer: Don't escape U+2019 as '.
Closes #4550.
Diffstat (limited to 'test/Tests/Writers/AsciiDoc.hs.orig')
-rw-r--r-- | test/Tests/Writers/AsciiDoc.hs.orig | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/Tests/Writers/AsciiDoc.hs.orig b/test/Tests/Writers/AsciiDoc.hs.orig new file mode 100644 index 000000000..6b97c0761 --- /dev/null +++ b/test/Tests/Writers/AsciiDoc.hs.orig @@ -0,0 +1,56 @@ +module Tests.Writers.AsciiDoc (tests) where + +import Data.Text (unpack) +import Test.Tasty +import Tests.Helpers +import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder + +asciidoc :: (ToPandoc a) => a -> String +asciidoc = unpack . purely (writeAsciiDoc def{ writerWrapText = WrapNone }) . toPandoc + +tests :: [TestTree] +tests = [ testGroup "emphasis" + [ test asciidoc "emph word before" $ + para (text "foo" <> emph (text "bar")) =?> + "foo__bar__" + , test asciidoc "emph word after" $ + para (emph (text "foo") <> text "bar") =?> + "__foo__bar" + , test asciidoc "emph quoted" $ + para (doubleQuoted (emph (text "foo"))) =?> + "``__foo__''" + , test asciidoc "strong word before" $ + para (text "foo" <> strong (text "bar")) =?> + "foo**bar**" + , test asciidoc "strong word after" $ + para (strong (text "foo") <> text "bar") =?> + "**foo**bar" + , test asciidoc "strong quoted" $ + para (singleQuoted (strong (text "foo"))) =?> + "`**foo**'" + ] + , testGroup "tables" + [ test asciidoc "empty cells" $ + simpleTable [] [[mempty],[mempty]] =?> unlines + [ "[cols=\"\",]" + , "|====" + , "|" + , "|" + , "|====" + ] + , test asciidoc "multiblock cells" $ + simpleTable [] [[para (text "Para 1") <> para (text "Para 2")]] + =?> unlines + [ "[cols=\"\",]" + , "|=====" + , "a|" + , "Para 1" + , "" + , "Para 2" + , "" + , "|=====" + ] + ] + ] |