Skip to content

Commit

Permalink
Merge pull request #361 from f3dm76/task/tests
Browse files Browse the repository at this point in the history
Add more W3C SVG tests
  • Loading branch information
ystrot authored May 16, 2018
2 parents 8cc3b07 + 283e1d4 commit e120be6
Show file tree
Hide file tree
Showing 31 changed files with 7,834 additions and 622 deletions.
1,252 changes: 682 additions & 570 deletions Macaw.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

64 changes: 62 additions & 2 deletions MacawTests/MacawSVGTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class MacawSVGTests: XCTestCase {
let clipReferenceContent = try String.init(contentsOfFile: path).trimmingCharacters(in: .newlines)
let result = SVGSerializer.serialize(node: node)
XCTAssertEqual(result, clipReferenceContent)
} else {
XCTFail("No file \(referenceFile)")
}
} catch {
print(error)
Expand Down Expand Up @@ -60,7 +62,7 @@ class MacawSVGTests: XCTestCase {
group1.place = Transform(dx: 100, dy: 100)
let node = Group(contents: [group1])

validate(node: node, referenceFile: "testBasicTransform")
validate(node: node, referenceFile: "textBasicTransform")
}

func testClipManual() {
Expand Down Expand Up @@ -88,7 +90,7 @@ class MacawSVGTests: XCTestCase {
let g3 = Group(contents:[Ellipse(cx: 20, cy: 20, rx: 20, ry:20).arc(shift: 3.14159250259399, extent: 2.67794513702393).stroke(fill: Color.green)], place: Transform(dx:110, dy: 140) )
let group = Group(contents:[g1, g2, g3])

validate(node: group, referenceFile: "arcsGroup")
validate(node: group, referenceFile: "arcsgroup")
}

func testSVGImage() {
Expand Down Expand Up @@ -165,6 +167,8 @@ class MacawSVGTests: XCTestCase {
let nodeContent = String(data: jsonData, encoding: String.Encoding.utf8)

XCTAssertEqual(nodeContent, referenceContent)
} else {
XCTFail("No file \(referenceFile)")
}
} catch {
XCTFail(error.localizedDescription)
Expand Down Expand Up @@ -472,4 +476,60 @@ class MacawSVGTests: XCTestCase {
func testPaintingControl03() {
validateJSON("painting-control-03-f-manual")
}

func testPaintingControl01() {
validateJSON("painting-control-01-f-manual")
}

func testPathsData14() {
validateJSON("paths-data-14-t-manual")
}

func testPaintingStroke06() {
validateJSON("painting-stroke-06-t-manual")
}

func testShapesEllipse03() {
validateJSON("shapes-ellipse-03-f-manual")
}

func testStructFrag06() {
validateJSON("struct-frag-06-t-manual")
}

func testShapesPolygon03() {
validateJSON("shapes-polygon-03-t-manual")
}

func testPathsData03() {
validateJSON("paths-data-03-f-manual")
}

func testPathsData08() {
validateJSON("paths-data-08-t-manual")
}

func testPathsData09() {
validateJSON("paths-data-09-t-manual")
}

func testPathsData16() {
validateJSON("paths-data-16-t-manual")
}

func testPathsData04() {
validateJSON("paths-data-04-t-manual")
}

func testPaintingStroke04() {
validateJSON("painting-stroke-04-t-manual")
}

func testPathsData05() {
validateJSON("paths-data-05-t-manual")
}

func testPathsData10() {
validateJSON("paths-data-10-t-manual")
}
}
91 changes: 41 additions & 50 deletions MacawTests/w3c-test-suite.md

Large diffs are not rendered by default.

Loading

0 comments on commit e120be6

Please sign in to comment.