summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-20 11:23:19 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-20 11:23:19 -0400
commit47b5634f389c005afc1826f12f7e244a0ab43d20 (patch)
treefd3820fa8576b8bb1f29acc8feca7da94451c549 /bs4/testing.py
parent8645d5e6b61804a5614b65db00312863189fb198 (diff)
downloadbeautifulsoup4-47b5634f389c005afc1826f12f7e244a0ab43d20.tar.gz
Fixed another bug by which the html5lib tree builder could create a
disconnected tree. [bug=1182089]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index 383f36a..d8ff6b7 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -246,6 +246,12 @@ class HTMLTreeBuilderSmokeTest(object):
self.assertSoupEquals("&#x10000000000000;", expect)
self.assertSoupEquals("&#1000000000;", expect)
+ def test_multipart_strings(self):
+ "Mostly to prevent a recurrence of a bug in the html5lib treebuilder."
+ soup = self.soup("<html><h2>\nfoo</h2><p></p></html>")
+ self.assertEqual("p", soup.h2.string.next_element.name)
+ self.assertEqual("p", soup.p.name)
+
def test_basic_namespaces(self):
"""Parsers don't need to *understand* namespaces, but at the
very least they should not choke on namespaces or lose