scour: Fix another variant of the crash from #260 (#264)

Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
Niels Thykier 2020-11-22 14:00:43 +00:00 committed by GitHub
parent 92e64f0d7f
commit b8a071f995
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 30 deletions

View file

@ -2099,6 +2099,12 @@ class GroupSiblingMerge(unittest.TestCase):
self.assertEqual(doc.getElementsByTagName('g').length, 8,
'Sibling merging is disabled by --disable-group-collapsing')
def test_sibling_merge_crash(self):
doc = scourXmlFile('unittests/group-sibling-merge-crash.svg',
parse_args(['']))
self.assertEqual(doc.getElementsByTagName('g').length, 1,
'Sibling merge should work without causing crashes')
class GroupCreation(unittest.TestCase):