Skip to content

Commit

Permalink
Include a test of the z_sort function
Browse files Browse the repository at this point in the history
  • Loading branch information
spakin committed Dec 23, 2023
1 parent a4a40dc commit 9fb14f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/data/refs/sis__e83b8e714fc4eddd89880961181b861c.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Created with Inkscape (http://www.inkscape.org/) --><svg xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" width="793.7007874" height="1122.519685">
<defs/>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.35" inkscape:cx="375" inkscape:cy="520" inkscape:document-units="px" inkscape:current-layer="layer1"/>
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"><rect x="40" y="40" width="100" height="60" style="stroke:black;fill:tan;opacity:0.9"/><rect x="30" y="30" width="100" height="60" style="stroke:black;fill:mediumseagreen;opacity:0.9"/><rect x="20" y="20" width="100" height="60" style="stroke:black;fill:mediumslateblue;opacity:0.9"/><rect x="10" y="10" width="100" height="60" style="stroke:black;fill:maroon;opacity:0.9"/><rect x="0" y="0" width="100" height="60" style="stroke:black;fill:beige;opacity:0.9"/></g>
</svg>
7 changes: 6 additions & 1 deletion tests/test_simple_inkscape_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,12 @@ class SimpInkScrTestModExObjs(CustomComparisonMixin,
("--program=%s\nboxes[-1].z_order('bottom')" % z_order,),
("--program=%s\nboxes[2].z_order('raise')" % z_order,),
("--program=%s\nboxes[3].z_order('lower', 2)" % z_order,),
("--program=%s\nboxes[1].z_order('to', 3)" % z_order,)
("--program=%s\nboxes[1].z_order('to', 3)" % z_order,),
(f'''--program=
{z_order}
for obj in z_sort(boxes):
obj.z_order('bottom')
''',)
]
compare_file = 'svg/default-inkscape-SVG.svg'

Expand Down

0 comments on commit 9fb14f1

Please sign in to comment.