summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-11-07 16:33:24 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-11-07 16:33:24 (GMT)
commit7165d8b9ba7df402fb167ff20dc6d1a35e7386ed (patch)
tree921e63e026e5d5d8f296e71e7dd81326cd370db9 /Lib/test
parentd5a2f0b3a13974e4a62d088aee6f920262c37add (diff)
downloadcpython-7165d8b9ba7df402fb167ff20dc6d1a35e7386ed.zip
cpython-7165d8b9ba7df402fb167ff20dc6d1a35e7386ed.tar.gz
cpython-7165d8b9ba7df402fb167ff20dc6d1a35e7386ed.tar.bz2
#19480: HTMLParser now accepts all valid start-tag names as defined by the HTML5 standard.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_htmlparser.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
index e8b8857..c977a9d 100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -229,6 +229,11 @@ text
self._parse_error("<a foo='bar")
self._parse_error("<a foo='>'")
self._parse_error("<a foo='>")
+ self._parse_error("<a$>")
+ self._parse_error("<a$b>")
+ self._parse_error("<a$b/>")
+ self._parse_error("<a$b >")
+ self._parse_error("<a$b />")
def test_valid_doctypes(self):
# from http://www.w3.org/QA/2002/04/valid-dtd-list.html
@@ -368,8 +373,8 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
('starttag', 'html', [('<html', None)]),
('data', 'te>>xt'),
('entityref', 'a'),
- ('data', '<<bc'),
- ('endtag', 'a'),
+ ('data', '<'),
+ ('starttag', 'bc<', [('a', None)]),
('endtag', 'html'),
('data', '\n<img src="URL>'),
('comment', '/img'),
@@ -380,8 +385,7 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
self._run_check("</$>", [('comment', '$')])
self._run_check("</", [('data', '</')])
self._run_check("</a", [('data', '</a')])
- # XXX this might be wrong
- self._run_check("<a<a>", [('data', '<a'), ('starttag', 'a', [])])
+ self._run_check("<a<a>", [('starttag', 'a<a', [])])
self._run_check("</a<a>", [('endtag', 'a<a')])
self._run_check("<!", [('data', '<!')])
self._run_check("<a", [('data', '<a')])
@@ -389,6 +393,11 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
self._run_check("<a foo='bar", [('data', "<a foo='bar")])
self._run_check("<a foo='>'", [('data', "<a foo='>'")])
self._run_check("<a foo='>", [('data', "<a foo='>")])
+ self._run_check("<a$>", [('starttag', 'a$', [])])
+ self._run_check("<a$b>", [('starttag', 'a$b', [])])
+ self._run_check("<a$b/>", [('startendtag', 'a$b', [])])
+ self._run_check("<a$b >", [('starttag', 'a$b', [])])
+ self._run_check("<a$b />", [('startendtag', 'a$b', [])])
def test_slashes_in_starttag(self):
self._run_check('<a foo="var"/>', [('startendtag', 'a', [('foo', 'var')])])