diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-13 21:42:50 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-13 21:42:50 -0500 |
commit | f93d5bf81e56515098785068a18f2befec37857a (patch) | |
tree | 75ac25db6fb90c2e52351d01c47a622351307023 /tests/test_lxml.py | |
parent | bc97bb3a83ee9fb4c8e31d11069ccf1cda61d4ff (diff) |
Ported more tests of bad declarations.
Diffstat (limited to 'tests/test_lxml.py')
-rw-r--r-- | tests/test_lxml.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_lxml.py b/tests/test_lxml.py index cba5522..6adc2b3 100644 --- a/tests/test_lxml.py +++ b/tests/test_lxml.py @@ -302,6 +302,17 @@ class TestLXMLBuilderInvalidMarkup(SoupTest): # Declarations that don't make any sense are ignored. self.assertSoupEquals('<! Foo = -8><p>a</p>', "<p>a</p>") + def test_whitespace_in_doctype(self): + # A declaration that has extra whitespace is ignored. + self.assertSoupEquals( + ('<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">' + '<p>foo</p>'), + '<p>foo</p>') + + def test_incomplete_declaration(self): + # An incomplete declaration will screw up the rest of the document. + self.assertSoupEquals('a<!b <p>c', '<p>a</p>') + def test_cdata_where_it_doesnt_belong(self): #CDATA sections are ignored. markup = "<div><![CDATA[foo]]>" |