summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_htmlparser.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-02-21 07:29:10 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-02-21 07:29:10 (GMT)
commit307da2b07040d0eea179cf989e3de8d9e75a9b2f (patch)
treec3043ecf176f5d84e7c31bf8c354594f3b3998da /Lib/test/test_htmlparser.py
parent79d38788ee5e00571db751d312612faf94f09eef (diff)
parent29877e8e04755c919b42ee012495f2e9671f3251 (diff)
downloadcpython-307da2b07040d0eea179cf989e3de8d9e75a9b2f.zip
cpython-307da2b07040d0eea179cf989e3de8d9e75a9b2f.tar.gz
cpython-307da2b07040d0eea179cf989e3de8d9e75a9b2f.tar.bz2
Merge the HTMLParser fix with 3.2.
Diffstat (limited to 'Lib/test/test_htmlparser.py')
-rw-r--r--Lib/test/test_htmlparser.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
index e2b09a9..3e2a590 100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -389,6 +389,27 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
self._run_check("<a foo='>'", [('data', "<a foo='>'")])
self._run_check("<a foo='>", [('data', "<a foo='>")])
+ def test_slashes_in_starttag(self):
+ self._run_check('<a foo="var"/>', [('startendtag', 'a', [('foo', 'var')])])
+ html = ('<img width=902 height=250px '
+ 'src="/sites/default/files/images/homepage/foo.jpg" '
+ '/*what am I doing here*/ />')
+ expected = [(
+ 'startendtag', 'img',
+ [('width', '902'), ('height', '250px'),
+ ('src', '/sites/default/files/images/homepage/foo.jpg'),
+ ('*what', None), ('am', None), ('i', None),
+ ('doing', None), ('here*', None)]
+ )]
+ self._run_check(html, expected)
+ html = ('<a / /foo/ / /=/ / /bar/ / />'
+ '<a / /foo/ / /=/ / /bar/ / >')
+ expected = [
+ ('startendtag', 'a', [('foo', None), ('=', None), ('bar', None)]),
+ ('starttag', 'a', [('foo', None), ('=', None), ('bar', None)])
+ ]
+ self._run_check(html, expected)
+
def test_declaration_junk_chars(self):
self._run_check("<!DOCTYPE foo $ >", [('decl', 'DOCTYPE foo $ ')])