Add tests for previous commit
This commit is contained in:
parent
4e07597e75
commit
3e0b43845b
2 changed files with 25 additions and 0 deletions
18
testscour.py
18
testscour.py
|
|
@ -1101,6 +1101,24 @@ class ChangeQuadToShorthandInPath(unittest.TestCase):
|
|||
'Did not change quadratic curves into shorthand curve segments in path')
|
||||
|
||||
|
||||
class BooleanFlagsInEllipticalPath(unittest.TestCase):
|
||||
|
||||
def test_omit_spaces(self):
|
||||
doc = scourXmlFile('unittests/path-elliptical-flags.svg', parse_args(['--no-renderer-workaround']))
|
||||
paths = doc.getElementsByTagNameNS(SVGNS, 'path')
|
||||
for path in paths:
|
||||
self.assertEqual(path.getAttribute('d'), 'm0 0a100 50 0 00100 50',
|
||||
'Did not ommit spaces after boolean flags in elliptical arg path command')
|
||||
|
||||
def test_output_spaces_with_renderer_workaround(self):
|
||||
doc = scourXmlFile('unittests/path-elliptical-flags.svg', parse_args(['--renderer-workaround']))
|
||||
paths = doc.getElementsByTagNameNS(SVGNS, 'path')
|
||||
for path in paths:
|
||||
self.assertEqual(path.getAttribute('d'), 'm0 0a100 50 0 0 0 100 50',
|
||||
'Did not output spaces after boolean flags in elliptical arg path command '
|
||||
'with renderer workaround')
|
||||
|
||||
|
||||
class DoNotOptimzePathIfLarger(unittest.TestCase):
|
||||
|
||||
def runTest(self):
|
||||
|
|
|
|||
7
unittests/path-elliptical-flags.svg
Normal file
7
unittests/path-elliptical-flags.svg
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg viewBox="-100 -50 300 150" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m0 0a100 50 0 0 0 100 50" fill="none" stroke="#000"/>
|
||||
<path d="m0 0a100 50 0 0 0100 50" fill="none" stroke="green"/>
|
||||
<path d="m0 0a100 50 0 00 100 50" fill="none" stroke="blue"/>
|
||||
<path d="m0 0a100 50 0 00100 50" fill="none" stroke="red"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 370 B |
Loading…
Add table
Add a link
Reference in a new issue