1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-08-15 16:10:39 +03:00

Fix #395: add svg test for paths-data-20-f-manual

This commit is contained in:
Daniil Manin 2019-05-23 18:50:46 +07:00
parent 3266afc07a
commit 86cef55ef8
4 changed files with 894 additions and 2 deletions

View File

@ -512,6 +512,8 @@
A74C81ED229284790085A832 /* struct-use-01-t-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C81EB229284780085A832 /* struct-use-01-t-manual.svg */; };
A74C81F12292B3940085A832 /* color-prop-05-t-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C81F02292B3940085A832 /* color-prop-05-t-manual.svg */; };
A74C81F32292B45E0085A832 /* color-prop-05-t-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C81F22292B45D0085A832 /* color-prop-05-t-manual.reference */; };
A74C82032296BE5F0085A832 /* paths-data-20-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */; };
A74C82052296BFC60085A832 /* paths-data-20-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */; };
A7E675561EC4213500BD9ECB /* NodeBoundsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E675551EC4213500BD9ECB /* NodeBoundsTests.swift */; };
C410148E1F834D290022EE44 /* style.svg in Resources */ = {isa = PBXBuildFile; fileRef = C410148D1F834D280022EE44 /* style.svg */; };
C4153A8F1F8793DE001BA5EE /* small-logo.png in Resources */ = {isa = PBXBuildFile; fileRef = C4153A8E1F8793DD001BA5EE /* small-logo.png */; };
@ -927,10 +929,12 @@
A718CD4B1F45C28F00966E06 /* MDisplayLink_macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MDisplayLink_macOS.swift; path = Source/platform/macOS/MDisplayLink_macOS.swift; sourceTree = SOURCE_ROOT; };
A718CD4C1F45C28F00966E06 /* MView_macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MView_macOS.swift; path = Source/platform/macOS/MView_macOS.swift; sourceTree = SOURCE_ROOT; };
A718CD511F45C2A400966E06 /* MBezierPath+Extension_macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MBezierPath+Extension_macOS.swift"; path = "Source/platform/macOS/MBezierPath+Extension_macOS.swift"; sourceTree = SOURCE_ROOT; };
A74C81F02292B3940085A832 /* color-prop-05-t-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-05-t-manual.svg"; sourceTree = "<group>"; };
A74C81F22292B45D0085A832 /* color-prop-05-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-05-t-manual.reference"; sourceTree = "<group>"; };
A74C81EA229284780085A832 /* struct-use-01-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "struct-use-01-t-manual.reference"; sourceTree = "<group>"; };
A74C81EB229284780085A832 /* struct-use-01-t-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "struct-use-01-t-manual.svg"; sourceTree = "<group>"; };
A74C81F02292B3940085A832 /* color-prop-05-t-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-05-t-manual.svg"; sourceTree = "<group>"; };
A74C81F22292B45D0085A832 /* color-prop-05-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-05-t-manual.reference"; sourceTree = "<group>"; };
A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "paths-data-20-f-manual.svg"; sourceTree = "<group>"; };
A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "paths-data-20-f-manual.reference"; sourceTree = "<group>"; };
A7E675551EC4213500BD9ECB /* NodeBoundsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NodeBoundsTests.swift; path = Bounds/NodeBoundsTests.swift; sourceTree = "<group>"; };
C410148D1F834D280022EE44 /* style.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = style.svg; sourceTree = "<group>"; };
C4153A8E1F8793DD001BA5EE /* small-logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "small-logo.png"; sourceTree = "<group>"; };
@ -1492,6 +1496,8 @@
5BFEF5D420BC1C1E008DAC11 /* paths-data-18-f-manual.svg */,
5B1AE1D720B6A669007EECCB /* paths-data-19-f-manual.reference */,
5B1AE21A20B6A669007EECCB /* paths-data-19-f-manual.svg */,
A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */,
A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */,
5B37139620BE95D7004BB6EE /* pservers-grad-01-b-manual.reference */,
5B37139220BE95D6004BB6EE /* pservers-grad-01-b-manual.svg */,
5B37139320BE95D6004BB6EE /* pservers-grad-02-b-manual.reference */,
@ -1815,6 +1821,7 @@
5B1AE29C20B6A669007EECCB /* paths-data-01-t-manual.reference in Resources */,
5B1AE29320B6A669007EECCB /* coords-trans-09-t-manual.svg in Resources */,
5B1AE2DC20B6A669007EECCB /* struct-defs-01-t-manual.svg in Resources */,
A74C82052296BFC60085A832 /* paths-data-20-f-manual.reference in Resources */,
5B1AE29020B6A669007EECCB /* painting-stroke-08-t-manual.svg in Resources */,
5B1AE2A720B6A669007EECCB /* paths-data-09-t-manual.svg in Resources */,
5B1AE2AB20B6A669007EECCB /* painting-stroke-08-t-manual.reference in Resources */,
@ -1868,6 +1875,7 @@
5B1AE2D120B6A669007EECCB /* paths-data-03-f-manual.reference in Resources */,
5B1AE28920B6A669007EECCB /* shapes-intro-01-t-manual.reference in Resources */,
5B1AE2C020B6A669007EECCB /* paths-data-14-t-manual.reference in Resources */,
A74C82032296BE5F0085A832 /* paths-data-20-f-manual.svg in Resources */,
5B1AE27420B6A669007EECCB /* color-prop-02-f-manual.svg in Resources */,
5B1AE25120B6A669007EECCB /* coords-trans-05-t-manual.reference in Resources */,
5B1AE29120B6A669007EECCB /* coords-transformattr-01-f-manual.svg in Resources */,

View File

@ -529,6 +529,10 @@ class MacawSVGTests: XCTestCase {
validateJSON("paths-data-19-f-manual")
}
func testPathsData20() {
validateJSON("paths-data-20-f-manual")
}
func testStructGroup01() {
validateJSON("struct-group-01-t-manual")
}

View File

@ -0,0 +1,793 @@
{
"contents" : [
{
"contents" : [
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
120,
120
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
0,
-25,
25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
120,
120
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
0,
-25,
25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
200,
120
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
1,
25,
25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
200,
120
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
1,
25,
25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
280,
120
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
0,
-25,
25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
280,
120
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
360,
120
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
1,
25,
25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
360,
120
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
120,
200
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
1,
-25,
-25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
120,
200
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
1,
-25,
-25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
200,
200
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
0,
25,
-25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
200,
200
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
280,
200
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
1,
-25,
-25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
280,
200
],
"type" : "M"
},
{
"data" : [
25
],
"type" : "h"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 65280
},
"form" : {
"segments" : [
{
"data" : [
360,
200
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
25,
25,
0,
1,
0,
25,
-25
],
"type" : "a"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 65280
},
"join" : "miter",
"width" : 1
}
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"segments" : [
{
"data" : [
360,
200
],
"type" : "M"
},
{
"data" : [
-25
],
"type" : "h"
},
{
"data" : [
],
"type" : "z"
}
],
"type" : "Path"
},
"node" : "Shape"
}
],
"node" : "Group"
},
{
"contents" : [
{
"align" : "min",
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 32,
"weight" : "normal"
},
"node" : "Text",
"place" : "1, 0, 0, 1, 10, 340",
"text" : "$Revision: 1.3 $"
}
],
"node" : "Group"
},
{
"form" : {
"h" : 358,
"type" : "Rect",
"w" : 478,
"x" : 1,
"y" : 1
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [
],
"fill" : {
"type" : "Color",
"val" : 0
},
"join" : "miter",
"width" : 1
}
}
],
"layout" : {
"scalingMode" : "meet",
"svgSize" : {
"height" : "100.0%",
"width" : "100.0%"
},
"viewBox" : {
"h" : 360,
"type" : "Rect",
"w" : 480,
"x" : 0,
"y" : 0
},
"xAligningMode" : "mid",
"yAligningMode" : "mid"
},
"node" : "Canvas"
}

View File

@ -0,0 +1,87 @@
<svg id="svg-root" width="100%" height="100%"
viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!--======================================================================-->
<!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, European Research Consortium for =-->
<!--= Informatics and Mathematics (ERCIM), Keio University). =-->
<!--= All Rights Reserved. =-->
<!--= See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
template-version="1.4" reviewer="CL" author="ED" status="accepted"
version="$Revision: 1.3 $" testname="$RCSfile: paths-data-20-f.svg,v $">
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/paths.html#PathDataEllipticalArcCommands">
<p>
Tests parsing of the elliptical arc path syntax.
</p>
</d:testDescription>
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
<p>
Run the test. No interaction required.
</p>
</d:operatorScript>
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
<p>
The test has passed if the image looks as if there are eight green circles that have
two white rectangles overlapping them, like in the reference image. If any red is visible
the test has failed.
</p>
</d:passCriteria>
</d:SVGTestCase>
<title id="test-title">$RCSfile: paths-data-20-f.svg,v $</title>
<defs>
<font-face
font-family="SVGFreeSansASCII"
unicode-range="U+0-7F">
<font-face-src>
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
</font-face-src>
</font-face>
</defs>
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
<!-- no commawsp between arc flags -->
<path d="M120,120 h25 a25,25 0 1,0 -25,25 z" fill="red" stroke="lime"/>
<path d="M120,120 h25 a25,25 0 10 -25,25z" fill="lime"/>
<!-- no commawsp between arc flags and no commawsp after arc flags -->
<path d="M200,120 h-25 a25,25 0 1,1 25,25 z" fill="red" stroke="lime"/>
<path d="M200,120 h-25 a25,25 0 1125,25 z" fill="lime"/>
<!-- out of range large-arc-flag value -->
<path d="M280,120 h25 a25,25 0 1,0 -25,25 z" fill="lime" stroke="lime"/>
<path d="M280,120 h25 a25,25 0 6 0 -25,25 z" fill="red"/>
<!-- negative sweep-flag value -->
<path d="M360,120 h-25 a25,25 0 1,1 25,25 z" fill="lime" stroke="lime"/>
<path d="M360,120 h-25 a25,25 0 1 -1 25,25 z" fill="red"/>
<!-- no commawsp between sweep-flag and following coordinate-pair -->
<path d="M120,200 h25 a25,25 0 1,1 -25,-25 z" fill="red" stroke="lime"/>
<path d="M120,200 h25 a25,25 0 1 1-25,-25 z" fill="lime"/>
<!-- no commawsp before arc flags -->
<path d="M200,200 h-25 a25,25 0 1,0 25,-25 z" fill="lime" stroke="lime"/>
<path d="M200,200 h-25 a25,2501 025,-25 z" fill="red"/>
<!-- out of range sweep-flag value -->
<path d="M280,200 h25 a25,25 0 1,1 -25,-25 z" fill="lime" stroke="lime"/>
<path d="M280,200 h25 a25 25 0 1 7 -25 -25 z" fill="red"/>
<!-- negative large-arc-flag value -->
<path d="M360,200 h-25 a25,25 0 1,0 25,-25 z" fill="lime" stroke="lime"/>
<path d="M360,200 h-25 a25,25 0 -1 0 25,-25 z" fill="red"/>
</g>
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
<text id="revision" x="10" y="340" stroke="none"
fill="black">$Revision: 1.3 $</text>
</g>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
<!-- comment out this watermark once the test is approved
<g id="draft-watermark">
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
</g> -->
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB