tests: ++coverage of the svg_loader

This commit is contained in:
Mira Grudzinska 2023-04-23 03:09:23 +02:00 committed by Hermet Park
parent b0991b6ce7
commit 5f5b4fdb80
2 changed files with 79 additions and 7 deletions

View file

@ -1,8 +1,48 @@
<svg width="1000" height="1000" viewBox="0 0 1000 1000" <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
xmlns="http://www.w3.org/2000/svg"> <!ELEMENT_NAME>
<?xml version="1.0" encoding="UTF-8"?>
<!--comment-->
<svg width="1000" height="1000" xmlns="http://www.w3.org/2000/svg">
<g color="green">
<symbol id="sym1" width="10" height="10" viewBox="0 0 2 2" preserveAspectRatio="none">
<use href="#rect2" fill="currentColor"/>
</symbol>
<symbol id="sym2" width="10" height="15" viewBox="0 0 2 2" preserveAspectRatio="xMidYMax slice">
<circle cx="1" cy="1" r="1" id="myCircle" fill="url(#grad1_1)" stroke="currentColor"/>
</symbol>
<symbol id="sym3" width="10" height="15" viewBox="0 0 2 2" preserveAspectRatio="xMaxYMin meet">
<use href="#myLine"/>
</symbol>
<symbol id="sym4" width="10" height="15" viewBox="0 0 2 2" preserveAspectRatio="xMaxYMax meet">
<ellipse cx="0" cy="1" rx="1" ry="0.5" fill="url(#grad2)" stroke="url(#grad2_1)" stroke-width="0.05" id="myElipse" clip-path="url(#myClip)" opacity="0.5" transform="translate(0,0)"/>
</symbol>
</g>
<symbol id="sym5" overflow="visible" viewBox="0 0 1000 1000" width="2" height="2" preserveAspectRatio="xMidYMid meet">
<circle cx="800" cy="10" r="10"/>
<circle cx="820" cy="10" r="10"/>
</symbol>
<symbol id="sym6" class="mySymbol" transform="scale(2)" viewBox="0 0 1000 1000" width="2" height="2" preserveAspectRatio="xMidYMin slice">
<circle cx="840" cy="10" r="10"/>
<circle cx="860" cy="10" r="10"/>
</symbol>
<g class="myFill">
<circle cx="880" cy="10" r="10"/>
<circle cx="900" cy="10" r="10"/>
</g>
<rect x="2" y="2" width="10" height="10" style="fill: red" class="mineStyle2"/>
<rect x="110" y="0"/>
<use href="#myPolygon" fill="currentColor"/>
<use href="#myPolyline"/>
<use href="&nbsp;#sym1&nbsp;" x="5" y="5em" transform="scale(2)" style="opacity:0.8;fill-opacity:1e12;stroke-opacity:1.175494351e-38;stroke-width:.e" />
<use href="#sym2" x="5" y="5" transform="scale(10) " style="opacity:0.7;fill-opacity:inf;stroke-opacity:infinity;stroke-width:nan" />
<use href="#sym3" x="+5" y="5" transform="scale(10)" style="opacity:0.9;" />
<use href="#sym4" x="5" y="5" transform = "scale(1e+1) rotate(-10)" style="opacity:1.0" />
<use href="#sym5"/>
<use href="#sym6" transform="scale(0.5)"/>
<g fill="url(#grad1)" mask="url(#vg)" transform="rotate(0 0 0) translate(2 0) scale(1.0)" style="color:blue"> <g fill="url(#grad1)" mask="url(#vg)" transform="rotate(0 0 0) translate(2 0) scale(1.0)" style="color:blue">
<path d="M420.82388 380H588.68467V422.805317H420.82388Z" stroke-width="0" stroke-dasharray="100%" stroke-dashoffset="0" /> <path d="M420.82388 380H588.68467V422.805317H420.82388Z" stroke-width="0" stroke-dasharray="100%" stroke-dashoffset="0" />
<path d="m420.82403 440.7101v63.94623l167.86079 25.5782V440.7101Z" style="opacity:0.9;color:black;fill:red;fill-rule:evenodd;stroke-width:10;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.9;stroke:black;display:inline;" transform="matrix(1,0,0,1,20,0)"/> <path d="m420.82403 440.7101v63.94623l167.86079 25.5782V440.7101Z" style="opacity:0.9;color:black;fill:red;fill-opacity:0.5;fill-rule:evenodd;stroke-width:10;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.9;stroke:black;display:inline;paint-order: stroke; " transform="matrix(1,0,0,1,20,0)" id="path1"/>
<use href="#path1" transform="translate(10,10)"/>
<path d="M420.82403 523.07258V673.47362L588.68482 612.59701V548.13942Z"/> <path d="M420.82403 523.07258V673.47362L588.68482 612.59701V548.13942Z"/>
<g stroke-width="3.864492"> <g stroke-width="3.864492">
<path d="M256.61221 100.51736H752.8963V386.99554H256.61221Z"/> <path d="M256.61221 100.51736H752.8963V386.99554H256.61221Z"/>
@ -19,13 +59,14 @@
<g></g> <g></g>
<polyline fill="none" stroke-width="10" <polyline fill="none" stroke-width="10"
points="0,0 1000,0 1000,1000 0,1000" /> points="0,0 1000,0 1000,1000 0,1000" />
<line x1="0" y1="0" x2="1000" y2="0" stroke="" /> <line x1="0" y1="0" x2="1000" y2="0" stroke="" id="lineId"/>
<path d="M647.5 800C692.5 786 730 786 775 800S857.5 814 902.5 800" stroke="#222f35" stroke="url(#grad1)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="white"/> <path d="M647.5 800C692.5 786 730 786 775 800S857.5 814 902.5 800" stroke="#222f35" stroke="url(#grad1)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="white"/>
<path d="M647.5 800Q711.25 786 775 800T902.5 800" stroke="#222f35" stroke="url(#grad2)" stroke-width="2" stroke-dasharray="20 10" stroke-linecap="square" stroke-linejoin="bevel" fill="white"/> <path d="M647.5 800Q711.25 786 775 800T902.5 800" stroke="#222f35" stroke="url(#grad2)" stroke-width="2" stroke-dasharray="20 10" stroke-linecap="square" stroke-linejoin="bevel" fill="white"/>
</g> </g>
<image href="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTAgNTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBmaWxsPSIjMjIyZjM1IiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiLz48L3N2Zz4=" height="50" width="50" x="650" y="875" /> <image href="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTAgNTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBmaWxsPSIjMjIyZjM1IiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiLz48L3N2Zz4=" height="50" width="50" x="650" y="875" />
<image href="data:image/svg+xml;utf8,%3Csvg viewBox='0 0 50 50' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle fill='%23222f35' cx='50%25' cy='50%25' r='50%25'/%3E%3C/svg%3E" height="50" width="50" x="725" y="875" /> <image href="data:image/svg+xml;utf8,%3Csvg viewBox='0 0 50 50' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle fill='%23222f35' cx='50%25' cy='50%25' r='50%25'/%3E%3C/svg%3E" height="50" width="50" x="725" y="875" />
<image href="data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2050%2050%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23222f35%22%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20r%3D%2250%25%22%2F%3E%3C%2Fsvg%3E" height="50" width="50" x="800" y="875" /> <image href="data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2050%2050%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23222f35%22%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20r%3D%2250%25%22%2F%3E%3C%2Fsvg%3E" height="50" width="50" x="800" y="875" id="img" transform="translate(-17,10)"/>
<use href="#img" transform="translate(57,-10)"/>
<path d="M885.834 872.086A45 45 0 1 1 885.834 919.815L909.698 895.95Z" fill="#223" opacity="0.6" stroke-linejoin="miter" stroke-linecap="round" id="man"/> <path d="M885.834 872.086A45 45 0 1 1 885.834 919.815L909.698 895.95Z" fill="#223" opacity="0.6" stroke-linejoin="miter" stroke-linecap="round" id="man"/>
<use href="#man" x="0" y="0" /> <use href="#man" x="0" y="0" />
<defs> <defs>
@ -33,11 +74,13 @@
<stop offset="0%" stop-color="#50585d"/> <stop offset="0%" stop-color="#50585d"/>
<stop offset="100%" stop-color="#252f35"/> <stop offset="100%" stop-color="#252f35"/>
</linearGradient> </linearGradient>
<linearGradient href="#grad1" id="grad1_1" gradientUnits="userSpaceOnUse"/>
<radialGradient id="grad2" cx="100%" cy="0.25" fx="0.5" fy="0.5" r="1.5" gradientTransform="scale(0.2)" spreadMethod="reflect"> <radialGradient id="grad2" cx="100%" cy="0.25" fx="0.5" fy="0.5" r="1.5" gradientTransform="scale(0.2)" spreadMethod="reflect">
<stop offset="0%" stop-color="#252f35" stop-opacity="80%"/> <stop offset="0%" stop-color="#252f35" stop-opacity="80%"/>
<stop offset="100%" style="stop-color:#000000;stop-opacity:1;"/> <stop offset="100%" style="stop-color:#000000;stop-opacity:1;"/>
</radialGradient> </radialGradient>
<mask id="vg"> <radialGradient href="#grad2" id="grad2_1" gradientUnits="userSpaceOnUse"/>
<mask id="vg" mask-type="alpha" maskContentUnits="userSpaceOnUse">
<circle style="stroke: black;" cx="50%" cy="50%" r="50%" /> <circle style="stroke: black;" cx="50%" cy="50%" r="50%" />
<rect fill="white" x="0" y="0" width="100%" height="100%" /> <rect fill="white" x="0" y="0" width="100%" height="100%" />
<path fill="black" d="m280 140h15v55l8 10 8-10v-55h15v60l-23 25-23-25z"/> <path fill="black" d="m280 140h15v55l8 10 8-10v-55h15v60l-23 25-23-25z"/>
@ -48,5 +91,34 @@
<rect x="0%" y="0%" width="1000" height="1000" /> <rect x="0%" y="0%" width="1000" height="1000" />
<polygon points="0,0 1000,0 1000,1000 0,1000" /> <polygon points="0,0 1000,0 1000,1000 0,1000" />
</clipPath> </clipPath>
<clipPath id="myClip">
<rect x="0%" y="0%" width="1" height="1"/>
</clipPath>
<rect x="0" y="0" width="10" height="10" id="rect2" class="mineStyle1"/>
<polygon points="0,100 50,25 50,75 100,0" fill="black" id="myPolygon"/>
<polyline points="0,100 50,25 50,75 100,0" transform="translate(0, 0)" id="myPolyline"/>
<style>
<![CDATA[
rect.mineStyle2 {
fill: grey; stroke: #000000; stroke-width: 4; transform: scale(2); clip-path: url(#clip)
}
rect {
fill: #00cc00; stroke: #99ff33; stroke-width: 5;
}
symbol {
fill: #ff00ff;
}
symbol.mySymbol {
fill: #ffff00;
}
.myFill {
fill: #0000ff;
}
rect.mineStyle1 {
fill: blue; stroke: #3399ff; fill-opacity: 0.7; stroke-opacity: 0.9; fill-rule: evenodd; stroke-width: 1; stroke-dasharray: 1; opacity: 0.9; stroke-linejoin: miter; stroke-linecap: butt; transform: scale(1); clip-path: url(#none); mask: url(#none);
}
]]>
</style>
<line x1="0" y1="0" x2="100" y2="150" stroke="black" id="myLine" stroke-width="0.1"/>
</defs> </defs>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.