aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/HTML.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs
index 7f5849991..9bf567194 100644
--- a/test/Tests/Readers/HTML.hs
+++ b/test/Tests/Readers/HTML.hs
@@ -108,6 +108,17 @@ tests = [ testGroup "base tag"
"<header id=\"title\">Title</header>" =?>
divWith ("title", mempty, mempty) (plain "Title")
]
+ , testGroup "code block"
+ [ test html "attributes in pre > code element" $
+ "<pre><code id=\"a\" class=\"python\">\nprint('hi')\n</code></pre>"
+ =?>
+ codeBlockWith ("a", ["python"], []) "print('hi')"
+
+ , test html "attributes in pre take precendence" $
+ "<pre id=\"c\"><code id=\"d\">\nprint('hi mom!')\n</code></pre>"
+ =?>
+ codeBlockWith ("c", [], []) "print('hi mom!')"
+ ]
, askOption $ \(QuickCheckTests numtests) ->
testProperty "Round trip" $
withMaxSuccess (if QuickCheckTests numtests == defaultValue