diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/Ms.hs | 37 | ||||
-rw-r--r-- | test/docx/golden/inline_formatting.docx | bin | 9989 -> 9987 bytes | |||
-rw-r--r-- | test/docx/inline_formatting.native | 2 | ||||
-rw-r--r-- | test/test-pandoc.hs | 2 |
4 files changed, 40 insertions, 1 deletions
diff --git a/test/Tests/Writers/Ms.hs b/test/Tests/Writers/Ms.hs new file mode 100644 index 000000000..d73603314 --- /dev/null +++ b/test/Tests/Writers/Ms.hs @@ -0,0 +1,37 @@ +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +module Tests.Writers.Ms (tests) where + +import Prelude +import Test.Tasty +import Tests.Helpers +import Text.Pandoc +import Text.Pandoc.Builder + +infix 4 =: +(=:) :: (ToString a, ToPandoc a) + => String -> (a, String) -> TestTree +(=:) = test (purely (writeMs def . toPandoc)) + +tests :: [TestTree] +tests = [ testGroup "code blocks" + [ "basic" + =: codeBlock "hello" + =?> unlines + [ ".IP" + , ".nf" + , "\\f[C]" + , "hello" + , "\\f[]" + , ".fi"] + , "escape starting ." + =: codeBlock ". hello" + =?> unlines + [ ".IP" + , ".nf" + , "\\f[C]" + , "\\&. hello" + , "\\f[]" + , ".fi"] + ] + ] diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx Binary files differindex 5efe66edd..ddfd45280 100644 --- a/test/docx/golden/inline_formatting.docx +++ b/test/docx/golden/inline_formatting.docx diff --git a/test/docx/inline_formatting.native b/test/docx/inline_formatting.native index 000896df9..df749ffef 100644 --- a/test/docx/inline_formatting.native +++ b/test/docx/inline_formatting.native @@ -1,6 +1,6 @@ Pandoc (Meta {unMeta = fromList []}) [Para [Str "Regular",Space,Str "text",Space,Emph [Str "italics"],Space,Strong [Str "bold",Space,Emph [Str "bold",Space,Str "italics"]],Str "."] ,Para [Str "This",Space,Str "is",Space,SmallCaps [Str "Small",Space,Str "Caps"],Str ",",Space,Str "and",Space,Str "this",Space,Str "is",Space,Strikeout [Str "strikethrough"],Str "."] -,Para [Str "Some",Space,Str "people",Space,Str "use",Space,Underline [Str "single",Space,Str "underlines",Space,Str "for",Space],Emph [Underline [Str "emphasis"]],Str "."] +,Para [Str "Some",Space,Str "people",Space,Str "use",Space,Underline [Str "single",Space,Str "underlines",Space,Str "for",Space,Emph [Str "emphasis"]],Str "."] ,Para [Str "Above",Space,Str "the",Space,Str "line",Space,Str "is",Space,Superscript [Str "superscript"],Space,Str "and",Space,Str "below",Space,Str "the",Space,Str "line",Space,Str "is",Space,Subscript [Str "subscript"],Str "."] ,Para [Str "A",Space,Str "line",LineBreak,Str "break."]] diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs index ff7661094..d0a1a6f18 100644 --- a/test/test-pandoc.hs +++ b/test/test-pandoc.hs @@ -37,6 +37,7 @@ import qualified Tests.Writers.JATS import qualified Tests.Writers.Jira import qualified Tests.Writers.LaTeX import qualified Tests.Writers.Markdown +import qualified Tests.Writers.Ms import qualified Tests.Writers.Muse import qualified Tests.Writers.Native import qualified Tests.Writers.Org @@ -70,6 +71,7 @@ tests pandocPath = testGroup "pandoc tests" , testGroup "Muse" Tests.Writers.Muse.tests , testGroup "FB2" Tests.Writers.FB2.tests , testGroup "PowerPoint" Tests.Writers.Powerpoint.tests + , testGroup "Ms" Tests.Writers.Ms.tests ] , testGroup "Readers" [ testGroup "LaTeX" Tests.Readers.LaTeX.tests |