From 75d9a62fe031195742b6d9f0647458af0fbd96f0 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 8 Sep 2004 22:57:01 +0000 Subject: [PATCH] add tests that make sure buffer boundaries are handled properly for SGML comments (see SF patch #901369) --- Lib/test/test_htmlparser.py | 13 +++++++++++++ Lib/test/test_sgmllib.py | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py index ffd3ebc124e..4cb87dfc215 100755 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -243,6 +243,19 @@ DOCTYPE html [ self._run_check([""], output) self._run_check([""], output) + output = [("comment", "abc")] + self._run_check(["", ""], output) + self._run_check(["<", "!--abc-->"], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check(["", ""], output) + def test_starttag_junk_chars(self): self._parse_error("") self._parse_error("") diff --git a/Lib/test/test_sgmllib.py b/Lib/test/test_sgmllib.py index 6a77e076fab..bc25bd0195c 100644 --- a/Lib/test/test_sgmllib.py +++ b/Lib/test/test_sgmllib.py @@ -307,6 +307,19 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN' self.check_events([""], output) self.check_events([""], output) + output = [("comment", "abc")] + self._run_check(["", ""], output) + self._run_check(["<", "!--abc-->"], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check([""], output) + self._run_check(["", ""], output) + def _test_starttag_junk_chars(self): self.check_parse_error("<") self.check_parse_error("<>")