Fix Bug 511186: Preserve comments surround <svg> root node

This commit is contained in:
JSCHILL1 2010-02-04 19:31:54 -06:00
parent 6147bb2085
commit c835423e8f
3 changed files with 25 additions and 7 deletions

View file

@ -987,7 +987,16 @@ class XmlEntities(unittest.TestCase):
def runTest(self):
self.assertEquals( scour.makeWellFormed('<>&"\''), '&lt;&gt;&amp;&quot;&apos;',
'Incorrectly translated XML entities')
class DoNotStripCommentsOutsideOfRoot(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/comments.svg')
self.assertEquals( doc.childNodes.length, 4,
'Did not include all comment children outside of root')
self.assertEquals( doc.childNodes[0].nodeType, 8, 'First node not a comment')
self.assertEquals( doc.childNodes[1].nodeType, 8, 'Second node not a comment')
self.assertEquals( doc.childNodes[3].nodeType, 8, 'Fourth node not a comment')
# TODO: write tests for --enable-viewboxing
# TODO; write a test for embedding rasters
# TODO: write a test for --disable-embed-rasters