aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Readers/HTML.hs6
-rw-r--r--test/Tests/Writers/HTML.hs22
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\">&gt;&gt;=</span></code></samp>")
+ ]
+ , testGroup "variable with style"
+ [ "var should wrap highlighted code" =:
+ codeWith ("",["haskell","variable"],[]) ">>="
+ =?> ("<var><code class=\"sourceCode haskell\">" ++
+ "<span class=\"op\">&gt;&gt;=</span></code></var>")
+ ]
]
where
tQ :: (ToString a, ToPandoc a)