diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-03-31 09:57:59 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-03-31 09:57:59 +0200 |
commit | ff9be6b38429b502b1582f2395b824305eb8c99c (patch) | |
tree | cf00c6ac9be4e80761c40d610d0db28914d30ad2 /test | |
parent | 9a42bec7fc8387bf7780cc3d3140c543e0ec6e32 (diff) | |
download | pandoc-ff9be6b38429b502b1582f2395b824305eb8c99c.tar.gz |
Jira writer: convert spans with class `underline` to inserted text
Spans with class `underline` as converted into Jira text marked as
`+inserted+`, i.e. surrounded by plus-signs.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/Jira.hs | 27 | ||||
-rw-r--r-- | test/test-pandoc.hs | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/Tests/Writers/Jira.hs b/test/Tests/Writers/Jira.hs new file mode 100644 index 000000000..063497fd1 --- /dev/null +++ b/test/Tests/Writers/Jira.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE OverloadedStrings #-} +module Tests.Writers.Jira (tests) where + +import Data.Text (unpack) +import Test.Tasty +import Tests.Helpers +import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder + +jira :: (ToPandoc a) => a -> String +jira = unpack . purely (writeJira def) . toPandoc + +infix 4 =: +(=:) :: (ToString a, ToPandoc a) + => String -> (a, String) -> TestTree +(=:) = test jira + +tests :: [TestTree] +tests = + [ testGroup "inlines" + [ "underlined text" =: + spanWith ("ignored", ["ignored", "underline"], [("foo", "bar")]) + "underlined text" =?> + "+underlined text+" + ] + ] diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs index 9d64b61b6..6f013a95c 100644 --- a/test/test-pandoc.hs +++ b/test/test-pandoc.hs @@ -34,6 +34,7 @@ import qualified Tests.Writers.Docx import qualified Tests.Writers.FB2 import qualified Tests.Writers.HTML import qualified Tests.Writers.JATS +import qualified Tests.Writers.Jira import qualified Tests.Writers.LaTeX import qualified Tests.Writers.Markdown import qualified Tests.Writers.Muse @@ -57,6 +58,7 @@ tests pandocPath = testGroup "pandoc tests" , testGroup "LaTeX" Tests.Writers.LaTeX.tests , testGroup "HTML" Tests.Writers.HTML.tests , testGroup "JATS" Tests.Writers.JATS.tests + , testGroup "Jira" Tests.Writers.Jira.tests , testGroup "Docbook" Tests.Writers.Docbook.tests , testGroup "Markdown" Tests.Writers.Markdown.tests , testGroup "Org" Tests.Writers.Org.tests |