diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-07-12 17:02:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-12 17:02:06 -0700 |
commit | c3b170be1c3c11465e5b0a64b6f59c875323a592 (patch) | |
tree | c7a23012a4ead8be5e3765efa7f2560cfcdb58d9 /test | |
parent | 651a3d96c499a27556f6a12591bc04bd4cba7630 (diff) | |
parent | 09ea10e2b1d8c746422e1a05562b37db4c71be55 (diff) | |
download | pandoc-c3b170be1c3c11465e5b0a64b6f59c875323a592.tar.gz |
Merge pull request #6513 from brisad/master
Escape starting periods in ms writer code blocks
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/Ms.hs | 37 | ||||
-rw-r--r-- | test/test-pandoc.hs | 2 |
2 files changed, 39 insertions, 0 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/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 |