From 6a186122c3a4aa202514a97c1dc8910ccfe19a5d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jun 2016 06:28:26 +0530 Subject: [PATCH] Add test for parsing of comments containing dashes --- src/calibre/ebooks/oeb/polish/tests/parsing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/tests/parsing.py b/src/calibre/ebooks/oeb/polish/tests/parsing.py index 39e3f48170..5c85508307 100644 --- a/src/calibre/ebooks/oeb/polish/tests/parsing.py +++ b/src/calibre/ebooks/oeb/polish/tests/parsing.py @@ -143,8 +143,13 @@ def attribute_replacement(test, parse_function): err = 'SVG attributes not normalized, parsed markup:\n' + etree.tostring(root) test.assertEqual(len(XPath('//svg:svg[@viewBox]')(root)), 2, err) +def comments(test, parse_function): + markup = '' + root = parse_function(markup) + test.assertEqual(len(XPath('//h:body')(root)), 1, 'Failed to parse with comment containing dashes') + basic_checks = (nonvoid_cdata_elements, namespaces, space_characters, - case_insensitive_element_names, entities, + case_insensitive_element_names, entities, comments, multiple_html_and_body, attribute_replacement) class ParsingTests(BaseTest):