Skip to content

Commit eafb2d2

Browse files
committed
Add invalid HTML comment closing tags test cases
1 parent 9147ff6 commit eafb2d2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Lib/test/test_htmlparser.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ def test_comments(self):
328328
'<!--->'
329329
'<!-->'
330330
'<!--<!--->'
331-
'<!--incorrectly-closed-comment--!>')
331+
'<!--And I am so-called incorrectly-closed-comment--!>'
332+
'<!--I have invalid attempt to close (space) -- >-->'
333+
'<!--Me too (invalid character) --x>-->'
334+
'<!--Me too (invalid characters) --cheese>-->')
332335
expected = [('comment', " I'm a valid comment "),
333336
('comment', 'me too!'),
334337
('comment', '--'),
@@ -339,7 +342,11 @@ def test_comments(self):
339342
('comment', ''),
340343
('comment', ''),
341344
('comment', '<!-'),
342-
('comment', 'incorrectly-closed-comment')]
345+
('comment', 'And I am so-called incorrectly-closed-comment'),
346+
('comment', 'I have invalid attempt to close (space) -- >'),
347+
('comment', 'Me too (invalid character) --x>'),
348+
('comment', 'Me too (invalid characters) --cheese>')
349+
]
343350
self._run_check(html, expected)
344351

345352
def test_condcoms(self):

0 commit comments

Comments
 (0)