Fix Bug 395645: Keep all identified children inside a defs (Thanks Frederik!)
+
Fix Bug 395647: Do not remove closepath (Z) path segments
diff --git a/testscour.py b/testscour.py
index d12f325..ce9459d 100755
--- a/testscour.py
+++ b/testscour.py
@@ -600,7 +600,13 @@ class DoNotRemoveGroupsWithIDsInDefs(unittest.TestCase):
def runTest(self):
f = scour.scourXmlFile('unittests/important-groups-in-defs.svg')
self.assertEquals(len(f.getElementsByTagNameNS(SVGNS, 'linearGradient')), 1,
- 'Group in defs with id\'ed element removed');
+ 'Group in defs with id\'ed element removed')
+
+class AlwaysKeepClosePathSegments(unittest.TestCase):
+ def runTest(self):
+ p= scour.scourXmlFile('unittests/path-with-closepath.svg').getElementsByTagNameNS(SVGNS, 'path')[0]
+ self.assertEquals(p.getAttribute('d'), 'M10,10h100v100h-100z',
+ 'Path with closepath not preserved')
# TODO: write tests for --set-precision for path data, for polygon data, for attributes
# TODO; write a test for embedding rasters
diff --git a/unittests/important-groups-in-defs.svg b/unittests/important-groups-in-defs.svg
new file mode 100644
index 0000000..44b718c
--- /dev/null
+++ b/unittests/important-groups-in-defs.svg
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/unittests/path-with-closepath.svg b/unittests/path-with-closepath.svg
new file mode 100644
index 0000000..c9c771b
--- /dev/null
+++ b/unittests/path-with-closepath.svg
@@ -0,0 +1,3 @@
+
\ No newline at end of file