summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>2017-12-20 23:55:48 +1300
committerHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>2017-12-22 15:24:54 +1300
commitd85357139748ea657f030ab314c39e70f56764f4 (patch)
treec85eaa9f1762ed93d6bc51ee050eb1e599061f03 /test
parent5d3c9e56460165be452b672f12fc476e7a5ed3a9 (diff)
Improve support for code language in JATS
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/JATS.hs5
-rw-r--r--test/Tests/Writers/JATS.hs7
2 files changed, 11 insertions, 1 deletions
diff --git a/test/Tests/Readers/JATS.hs b/test/Tests/Readers/JATS.hs
index ed6317c71..5c7dfa77c 100644
--- a/test/Tests/Readers/JATS.hs
+++ b/test/Tests/Readers/JATS.hs
@@ -14,6 +14,11 @@ jats = purely $ readJATS def
tests :: [TestTree]
tests = [ testGroup "inline code"
[ test jats "basic" $ "<p>\n <monospace>@&amp;</monospace>\n</p>" =?> para (code "@&")
+ , test jats "lang" $ "<p>\n <code language=\"c\">@&amp;</code>\n</p>" =?> para (codeWith ("", ["c"], []) "@&")
+ ]
+ , testGroup "block code"
+ [ test jats "basic" $ "<preformat>@&amp;</preformat>" =?> codeBlock "@&"
+ , test jats "lang" $ "<code language=\"c\">@&amp;</code>" =?> codeBlockWith ("", ["c"], []) "@&"
]
, testGroup "images"
[ test jats "basic" $ "<graphic mimetype=\"image\" mime-subtype=\"\" xlink:href=\"/url\" xlink:title=\"title\" />"
diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs
index cd4609849..f14f1c229 100644
--- a/test/Tests/Writers/JATS.hs
+++ b/test/Tests/Writers/JATS.hs
@@ -31,6 +31,11 @@ infix 4 =:
tests :: [TestTree]
tests = [ testGroup "inline code"
[ "basic" =: code "@&" =?> "<p>\n <monospace>@&amp;</monospace>\n</p>"
+ , "lang" =: codeWith ("", ["c"], []) "@&" =?> "<p>\n <code language=\"c\">@&amp;</code>\n</p>"
+ ]
+ , testGroup "block code"
+ [ "basic" =: codeBlock "@&" =?> "<preformat>@&amp;</preformat>"
+ , "lang" =: codeBlockWith ("", ["c"], []) "@&" =?> "<code language=\"c\">@&amp;</code>"
]
, testGroup "images"
[ "basic" =:
@@ -38,7 +43,7 @@ tests = [ testGroup "inline code"
=?> "<graphic mimetype=\"image\" mime-subtype=\"\" xlink:href=\"/url\" xlink:title=\"title\" />"
]
, testGroup "inlines"
- [ "Emphasis" =: emph ("emphasized")
+ [ "Emphasis" =: emph "emphasized"
=?> "<p>\n <italic>emphasized</italic>\n</p>"
]
, "bullet list" =: bulletList [ plain $ text "first"