diff options
author | Amogh Rathore <amoghdroid09@gmail.com> | 2019-11-05 01:42:30 +0900 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-11-04 08:42:30 -0800 |
commit | bd2bd9b19d949f59a64358f756bf8b398a13db0f (patch) | |
tree | a266e1c6ae9a0d183695bd82e9cd5a89e12d8970 /test | |
parent | fdc0f47519d330bcc641eeaee68486431d3c46a5 (diff) | |
download | pandoc-bd2bd9b19d949f59a64358f756bf8b398a13db0f.tar.gz |
HTML Reader/Writer - Add support for <var> and <samp> (#5861)
Closes #5799
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Readers/HTML.hs | 6 | ||||
-rw-r--r-- | test/Tests/Writers/HTML.hs | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 17ca717ea..31299e40d 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -95,6 +95,12 @@ tests = [ testGroup "base tag" "<samp>Answer is 42</samp>" =?> plain (codeWith ("",["sample"],[]) "Answer is 42") ] + , testGroup "var" + [ + test html "inline var block" $ + "<var>result</var>" =?> + plain (codeWith ("",["variable"],[]) "result") + ] , askOption $ \(QuickCheckTests numtests) -> testProperty "Round trip" $ withMaxSuccess (if QuickCheckTests numtests == defaultValue diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index 94549e0d8..f3c7b87fd 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -61,6 +61,28 @@ tests = [ testGroup "inline code" doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples")) =?> "<q cite=\"http://example.org\">examples</q>" ] + , testGroup "sample" + [ "sample should be rendered correctly" =: + plain (codeWith ("",["sample"],[]) "Answer is 42") =?> + "<samp>Answer is 42</samp>" + ] + , testGroup "variable" + [ "variable should be rendered correctly" =: + plain (codeWith ("",["variable"],[]) "result") =?> + "<var>result</var>" + ] + , testGroup "sample with style" + [ "samp should wrap highlighted code" =: + codeWith ("",["sample","haskell"],[]) ">>=" + =?> ("<samp><code class=\"sourceCode haskell\">" ++ + "<span class=\"op\">>>=</span></code></samp>") + ] + , testGroup "variable with style" + [ "var should wrap highlighted code" =: + codeWith ("",["haskell","variable"],[]) ">>=" + =?> ("<var><code class=\"sourceCode haskell\">" ++ + "<span class=\"op\">>>=</span></code></var>") + ] ] where tQ :: (ToString a, ToPandoc a) |