Add closepath test

This commit is contained in:
JSCHILL1 2009-07-05 08:14:40 -05:00
parent 06f008a908
commit f1f0aab965
4 changed files with 23 additions and 2 deletions

View file

@ -13,10 +13,11 @@
<header>
<h2><a href="#0.15">Version 0.15</a></h2>
</header>
<p>July 4th, 2009</p>
<p>July 5th, 2009</p>
<ul>
<li>added --keep-editor-data command-line option</li>
<li>Fix Bug 395645: Keep all identified children inside a defs (Thanks Frederik!)</li>
<li>Fix Bug 395647: Do not remove closepath (Z) path segments</li>
</ul>
</section>

View file

@ -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

View file

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<g>
<linearGradient id="g1">
<stop offset="0" stop-color="blue"/>
<stop offset="1" stop-color="red"/>
</linearGradient>
</g>
</defs>
<rect fill="url(#g1)" width="100" height="100" />
</svg>

After

Width:  |  Height:  |  Size: 249 B

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg">
<path fill="none" stroke="#000" d="M10,10h100v100h-100z"/>
</svg>

After

Width:  |  Height:  |  Size: 106 B