add tests that make sure buffer boundaries are handled properly for SGML comments
(see SF patch #901369)
This commit is contained in:
parent
0b4a7d95c3
commit
75d9a62fe0
|
@ -243,6 +243,19 @@ DOCTYPE html [
|
|||
self._run_check(["<a b='>", "'>"], output)
|
||||
self._run_check(["<a b='>'", ">"], output)
|
||||
|
||||
output = [("comment", "abc")]
|
||||
self._run_check(["", "<!--abc-->"], output)
|
||||
self._run_check(["<", "!--abc-->"], output)
|
||||
self._run_check(["<!", "--abc-->"], output)
|
||||
self._run_check(["<!-", "-abc-->"], output)
|
||||
self._run_check(["<!--", "abc-->"], output)
|
||||
self._run_check(["<!--a", "bc-->"], output)
|
||||
self._run_check(["<!--ab", "c-->"], output)
|
||||
self._run_check(["<!--abc", "-->"], output)
|
||||
self._run_check(["<!--abc-", "->"], output)
|
||||
self._run_check(["<!--abc--", ">"], output)
|
||||
self._run_check(["<!--abc-->", ""], output)
|
||||
|
||||
def test_starttag_junk_chars(self):
|
||||
self._parse_error("</>")
|
||||
self._parse_error("</$>")
|
||||
|
|
|
@ -307,6 +307,19 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
|
|||
self.check_events(["<a b='>", "'>"], output)
|
||||
self.check_events(["<a b='>'", ">"], output)
|
||||
|
||||
output = [("comment", "abc")]
|
||||
self._run_check(["", "<!--abc-->"], output)
|
||||
self._run_check(["<", "!--abc-->"], output)
|
||||
self._run_check(["<!", "--abc-->"], output)
|
||||
self._run_check(["<!-", "-abc-->"], output)
|
||||
self._run_check(["<!--", "abc-->"], output)
|
||||
self._run_check(["<!--a", "bc-->"], output)
|
||||
self._run_check(["<!--ab", "c-->"], output)
|
||||
self._run_check(["<!--abc", "-->"], output)
|
||||
self._run_check(["<!--abc-", "->"], output)
|
||||
self._run_check(["<!--abc--", ">"], output)
|
||||
self._run_check(["<!--abc-->", ""], output)
|
||||
|
||||
def _test_starttag_junk_chars(self):
|
||||
self.check_parse_error("<")
|
||||
self.check_parse_error("<>")
|
||||
|
|
Loading…
Reference in New Issue