Add a check to prevent we make path data longer by "optimization"
This commit is contained in:
parent
21e6c7491b
commit
0c63344ea4
3 changed files with 18 additions and 2 deletions
|
|
@ -685,6 +685,14 @@ class ChangeQuadToShorthandInPath(unittest.TestCase):
|
|||
self.assertEqual(path.getAttribute('d'), 'm10 100q50-50 100 0t100 0',
|
||||
'Did not change quadratic curves into shorthand curve segments in path')
|
||||
|
||||
class DoNotOptimzePathIfLarger(unittest.TestCase):
|
||||
def runTest(self):
|
||||
p = scour.scourXmlFile('unittests/path-no-optimize.svg').getElementsByTagNameNS(SVGNS, 'path')[0];
|
||||
self.assertTrue(len(p.getAttribute('d')) <= len("M100,100 L200.12345,200.12345 C215,205 185,195 200.12,200.12 Z"),
|
||||
'Made path data longer during optimization')
|
||||
# this was the scoured path data as of 2016-08-31 without the length check in cleanPath():
|
||||
# d="m100 100l100.12 100.12c14.877 4.8766-15.123-5.1234-0.00345-0.00345z"
|
||||
|
||||
class HandleEncodingUTF8(unittest.TestCase):
|
||||
def runTest(self):
|
||||
doc = scour.scourXmlFile('unittests/encoding-utf8.svg')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue