Skip to content

Commit 01d1859

Browse files
committed
update XCTestCase class declarations
1 parent 9a10e28 commit 01d1859

30 files changed

+167
-103
lines changed

SwiftDraw.xcodeproj/project.pbxproj

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
D90DB438219CD1C600D374D2 /* DOM.Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB425219CD1C500D374D2 /* DOM.Image.swift */; };
9090
D90DB439219CD1C600D374D2 /* DOM.Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB426219CD1C500D374D2 /* DOM.Color.swift */; };
9191
D90DB43A219CD1C600D374D2 /* DOM.Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB426219CD1C500D374D2 /* DOM.Color.swift */; };
92-
D90DB43E219CD1EC00D374D2 /* DOM.Element.Equality.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB43C219CD1EC00D374D2 /* DOM.Element.Equality.swift */; };
93-
D90DB43F219CD1EC00D374D2 /* DOM.Element.Equality.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB43C219CD1EC00D374D2 /* DOM.Element.Equality.swift */; };
92+
D90DB43E219CD1EC00D374D2 /* DOM+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB43C219CD1EC00D374D2 /* DOM+Extensions.swift */; };
93+
D90DB43F219CD1EC00D374D2 /* DOM+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB43C219CD1EC00D374D2 /* DOM+Extensions.swift */; };
9494
D90DB440219CD1EC00D374D2 /* DOM.ElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB43D219CD1EC00D374D2 /* DOM.ElementTests.swift */; };
9595
D90DB441219CD1EC00D374D2 /* DOM.ElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB43D219CD1EC00D374D2 /* DOM.ElementTests.swift */; };
9696
D90DB44E219CD27800D374D2 /* Parser.XML.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB443219CD27700D374D2 /* Parser.XML.swift */; };
@@ -133,14 +133,14 @@
133133
D90DB484219CD2C300D374D2 /* UseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46C219CD2C200D374D2 /* UseTests.swift */; };
134134
D90DB485219CD2C300D374D2 /* StyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46D219CD2C200D374D2 /* StyleTests.swift */; };
135135
D90DB486219CD2C300D374D2 /* StyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46D219CD2C200D374D2 /* StyleTests.swift */; };
136-
D90DB487219CD2C300D374D2 /* Parser.ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46E219CD2C200D374D2 /* Parser.ImageTests.swift */; };
137-
D90DB488219CD2C300D374D2 /* Parser.ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46E219CD2C200D374D2 /* Parser.ImageTests.swift */; };
136+
D90DB487219CD2C300D374D2 /* ParserSVGImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46E219CD2C200D374D2 /* ParserSVGImageTests.swift */; };
137+
D90DB488219CD2C300D374D2 /* ParserSVGImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46E219CD2C200D374D2 /* ParserSVGImageTests.swift */; };
138138
D90DB489219CD2C300D374D2 /* Parser.XML.TransformTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46F219CD2C200D374D2 /* Parser.XML.TransformTests.swift */; };
139139
D90DB48A219CD2C300D374D2 /* Parser.XML.TransformTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB46F219CD2C200D374D2 /* Parser.XML.TransformTests.swift */; };
140140
D90DB48D219CD2C300D374D2 /* Parser.GraphicAttributeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB471219CD2C200D374D2 /* Parser.GraphicAttributeTests.swift */; };
141141
D90DB48E219CD2C300D374D2 /* Parser.GraphicAttributeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB471219CD2C200D374D2 /* Parser.GraphicAttributeTests.swift */; };
142-
D90DB48F219CD2C300D374D2 /* ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB472219CD2C200D374D2 /* ImageTests.swift */; };
143-
D90DB490219CD2C300D374D2 /* ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB472219CD2C200D374D2 /* ImageTests.swift */; };
142+
D90DB48F219CD2C300D374D2 /* Parser.XML.ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB472219CD2C200D374D2 /* Parser.XML.ImageTests.swift */; };
143+
D90DB490219CD2C300D374D2 /* Parser.XML.ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB472219CD2C200D374D2 /* Parser.XML.ImageTests.swift */; };
144144
D90DB491219CD2C300D374D2 /* Parser.SVGTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB473219CD2C200D374D2 /* Parser.SVGTests.swift */; };
145145
D90DB492219CD2C300D374D2 /* Parser.SVGTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB473219CD2C200D374D2 /* Parser.SVGTests.swift */; };
146146
D90DB493219CD2C300D374D2 /* ElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90DB474219CD2C200D374D2 /* ElementTests.swift */; };
@@ -167,6 +167,8 @@
167167
D9C47AC71ED54FA100178D06 /* viewbox.svg in Resources */ = {isa = PBXBuildFile; fileRef = D9C47AC11ED54FA100178D06 /* viewbox.svg */; };
168168
D9F3AD5A219E9DF400BAFA55 /* XML.SAXParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9F3AD59219E9DF400BAFA55 /* XML.SAXParserTests.swift */; };
169169
D9F3AD5B219E9DF400BAFA55 /* XML.SAXParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9F3AD59219E9DF400BAFA55 /* XML.SAXParserTests.swift */; };
170+
D9F3AD5E21A218CF00BAFA55 /* ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9F3AD5D21A218CF00BAFA55 /* ImageTests.swift */; };
171+
D9F3AD5F21A218CF00BAFA55 /* ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9F3AD5D21A218CF00BAFA55 /* ImageTests.swift */; };
170172
D9F3EBBB1DFF5BA3006691A1 /* SwiftDraw.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9F3EBB11DFF5BA3006691A1 /* SwiftDraw.framework */; };
171173
D9F3EBC21DFF5BA3006691A1 /* SwiftDraw.h in Headers */ = {isa = PBXBuildFile; fileRef = D9F3EBB41DFF5BA3006691A1 /* SwiftDraw.h */; settings = {ATTRIBUTES = (Public, ); }; };
172174
/* End PBXBuildFile section */
@@ -232,7 +234,7 @@
232234
D90DB424219CD1C500D374D2 /* DOM.SVG.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DOM.SVG.swift; sourceTree = "<group>"; };
233235
D90DB425219CD1C500D374D2 /* DOM.Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DOM.Image.swift; sourceTree = "<group>"; };
234236
D90DB426219CD1C500D374D2 /* DOM.Color.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DOM.Color.swift; sourceTree = "<group>"; };
235-
D90DB43C219CD1EC00D374D2 /* DOM.Element.Equality.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DOM.Element.Equality.swift; sourceTree = "<group>"; };
237+
D90DB43C219CD1EC00D374D2 /* DOM+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DOM+Extensions.swift"; sourceTree = "<group>"; };
236238
D90DB43D219CD1EC00D374D2 /* DOM.ElementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DOM.ElementTests.swift; sourceTree = "<group>"; };
237239
D90DB443219CD27700D374D2 /* Parser.XML.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.XML.swift; sourceTree = "<group>"; };
238240
D90DB444219CD27700D374D2 /* Parser.XML.Color.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.XML.Color.swift; sourceTree = "<group>"; };
@@ -254,10 +256,10 @@
254256
D90DB46B219CD2C200D374D2 /* Parser.PathTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.PathTests.swift; sourceTree = "<group>"; };
255257
D90DB46C219CD2C200D374D2 /* UseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UseTests.swift; sourceTree = "<group>"; };
256258
D90DB46D219CD2C200D374D2 /* StyleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyleTests.swift; sourceTree = "<group>"; };
257-
D90DB46E219CD2C200D374D2 /* Parser.ImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.ImageTests.swift; sourceTree = "<group>"; };
259+
D90DB46E219CD2C200D374D2 /* ParserSVGImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParserSVGImageTests.swift; sourceTree = "<group>"; };
258260
D90DB46F219CD2C200D374D2 /* Parser.XML.TransformTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.XML.TransformTests.swift; sourceTree = "<group>"; };
259261
D90DB471219CD2C200D374D2 /* Parser.GraphicAttributeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.GraphicAttributeTests.swift; sourceTree = "<group>"; };
260-
D90DB472219CD2C200D374D2 /* ImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageTests.swift; sourceTree = "<group>"; };
262+
D90DB472219CD2C200D374D2 /* Parser.XML.ImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.XML.ImageTests.swift; sourceTree = "<group>"; };
261263
D90DB473219CD2C200D374D2 /* Parser.SVGTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.SVGTests.swift; sourceTree = "<group>"; };
262264
D90DB474219CD2C200D374D2 /* ElementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ElementTests.swift; sourceTree = "<group>"; };
263265
D90DB496219CD32600D374D2 /* Formatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Formatter.swift; sourceTree = "<group>"; };
@@ -273,6 +275,7 @@
273275
D9C47AC01ED54FA100178D06 /* transform.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = transform.svg; sourceTree = "<group>"; };
274276
D9C47AC11ED54FA100178D06 /* viewbox.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = viewbox.svg; sourceTree = "<group>"; };
275277
D9F3AD59219E9DF400BAFA55 /* XML.SAXParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XML.SAXParserTests.swift; sourceTree = "<group>"; };
278+
D9F3AD5D21A218CF00BAFA55 /* ImageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageTests.swift; sourceTree = "<group>"; };
276279
D9F3EBB11DFF5BA3006691A1 /* SwiftDraw.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftDraw.framework; sourceTree = BUILT_PRODUCTS_DIR; };
277280
D9F3EBB41DFF5BA3006691A1 /* SwiftDraw.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftDraw.h; sourceTree = "<group>"; };
278281
D9F3EBB51DFF5BA3006691A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -456,7 +459,7 @@
456459
D90DB43B219CD1E000D374D2 /* DOM */ = {
457460
isa = PBXGroup;
458461
children = (
459-
D90DB43C219CD1EC00D374D2 /* DOM.Element.Equality.swift */,
462+
D90DB43C219CD1EC00D374D2 /* DOM+Extensions.swift */,
460463
D90DB43D219CD1EC00D374D2 /* DOM.ElementTests.swift */,
461464
);
462465
name = DOM;
@@ -487,14 +490,14 @@
487490
D90DB465219CD2C100D374D2 /* CoordinateTests.swift */,
488491
D90DB474219CD2C200D374D2 /* ElementTests.swift */,
489492
D90DB468219CD2C100D374D2 /* GradientTests.swift */,
490-
D90DB472219CD2C200D374D2 /* ImageTests.swift */,
493+
D90DB46E219CD2C200D374D2 /* ParserSVGImageTests.swift */,
491494
D90DB471219CD2C200D374D2 /* Parser.GraphicAttributeTests.swift */,
492-
D90DB46E219CD2C200D374D2 /* Parser.ImageTests.swift */,
493495
D90DB46B219CD2C200D374D2 /* Parser.PathTests.swift */,
494496
D90DB473219CD2C200D374D2 /* Parser.SVGTests.swift */,
495497
D90DB46D219CD2C200D374D2 /* StyleTests.swift */,
496498
D90DB467219CD2C100D374D2 /* TextTests.swift */,
497499
D90DB46A219CD2C100D374D2 /* Parser.XML.ColorTests.swift */,
500+
D90DB472219CD2C200D374D2 /* Parser.XML.ImageTests.swift */,
498501
D90DB46F219CD2C200D374D2 /* Parser.XML.TransformTests.swift */,
499502
D90DB46C219CD2C200D374D2 /* UseTests.swift */,
500503
D90DB466219CD2C100D374D2 /* ValueParserTests.swift */,
@@ -535,6 +538,14 @@
535538
path = Samples;
536539
sourceTree = "<group>";
537540
};
541+
D9F3AD5C21A2172800BAFA55 /* Image */ = {
542+
isa = PBXGroup;
543+
children = (
544+
D9F3AD5D21A218CF00BAFA55 /* ImageTests.swift */,
545+
);
546+
name = Image;
547+
sourceTree = "<group>";
548+
};
538549
D9F3EBA71DFF5BA3006691A1 = {
539550
isa = PBXGroup;
540551
children = (
@@ -576,6 +587,7 @@
576587
isa = PBXGroup;
577588
children = (
578589
D90DB3F2219CCF1A00D374D2 /* Extensions */,
590+
D9F3AD5C21A2172800BAFA55 /* Image */,
579591
D90DB3C5219CCC7200D374D2 /* LayerTree */,
580592
D90DB32D219CCB7300D374D2 /* Renderer */,
581593
D90DB49C219CD37C00D374D2 /* SVG */,
@@ -833,9 +845,9 @@
833845
files = (
834846
D90DB494219CD2C300D374D2 /* ElementTests.swift in Sources */,
835847
D90DB441219CD1EC00D374D2 /* DOM.ElementTests.swift in Sources */,
836-
D90DB43F219CD1EC00D374D2 /* DOM.Element.Equality.swift in Sources */,
837-
D90DB488219CD2C300D374D2 /* Parser.ImageTests.swift in Sources */,
838-
D90DB490219CD2C300D374D2 /* ImageTests.swift in Sources */,
848+
D90DB43F219CD1EC00D374D2 /* DOM+Extensions.swift in Sources */,
849+
D90DB488219CD2C300D374D2 /* ParserSVGImageTests.swift in Sources */,
850+
D90DB490219CD2C300D374D2 /* Parser.XML.ImageTests.swift in Sources */,
839851
D90DB482219CD2C300D374D2 /* Parser.PathTests.swift in Sources */,
840852
D90DB3F5219CCF2700D374D2 /* URL+DataTests.swift in Sources */,
841853
D90DB3D6219CCC8A00D374D2 /* LayerTree.ShapeTests.swift in Sources */,
@@ -856,6 +868,7 @@
856868
D90DB3D4219CCC8A00D374D2 /* LayerTree.LayerTests.swift in Sources */,
857869
D90DB476219CD2C300D374D2 /* CoordinateTests.swift in Sources */,
858870
D90DB48E219CD2C300D374D2 /* Parser.GraphicAttributeTests.swift in Sources */,
871+
D9F3AD5F21A218CF00BAFA55 /* ImageTests.swift in Sources */,
859872
D90DB480219CD2C300D374D2 /* Parser.XML.ColorTests.swift in Sources */,
860873
D90DB478219CD2C300D374D2 /* ValueParserTests.swift in Sources */,
861874
D90DB3D5219CCC8A00D374D2 /* LayerTree.PathTests.swift in Sources */,
@@ -919,9 +932,9 @@
919932
files = (
920933
D90DB493219CD2C300D374D2 /* ElementTests.swift in Sources */,
921934
D90DB440219CD1EC00D374D2 /* DOM.ElementTests.swift in Sources */,
922-
D90DB43E219CD1EC00D374D2 /* DOM.Element.Equality.swift in Sources */,
923-
D90DB487219CD2C300D374D2 /* Parser.ImageTests.swift in Sources */,
924-
D90DB48F219CD2C300D374D2 /* ImageTests.swift in Sources */,
935+
D90DB43E219CD1EC00D374D2 /* DOM+Extensions.swift in Sources */,
936+
D90DB487219CD2C300D374D2 /* ParserSVGImageTests.swift in Sources */,
937+
D90DB48F219CD2C300D374D2 /* Parser.XML.ImageTests.swift in Sources */,
925938
D90DB481219CD2C300D374D2 /* Parser.PathTests.swift in Sources */,
926939
D90DB3D0219CCC8100D374D2 /* LayerTree.LayerTests.swift in Sources */,
927940
D90DB3D1219CCC8100D374D2 /* LayerTree.ShapeTests.swift in Sources */,
@@ -942,6 +955,7 @@
942955
D90DB3CC219CCC8100D374D2 /* LayerTree.ColorTests.swift in Sources */,
943956
D90DB475219CD2C300D374D2 /* CoordinateTests.swift in Sources */,
944957
D90DB48D219CD2C300D374D2 /* Parser.GraphicAttributeTests.swift in Sources */,
958+
D9F3AD5E21A218CF00BAFA55 /* ImageTests.swift in Sources */,
945959
D90DB47F219CD2C300D374D2 /* Parser.XML.ColorTests.swift in Sources */,
946960
D90DB477219CD2C300D374D2 /* ValueParserTests.swift in Sources */,
947961
D90DB3CF219CCC8100D374D2 /* LayerTree.PathTests.swift in Sources */,

SwiftDrawTests/AttributeParserTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class AttributeParserTests: XCTestCase {
35+
final class AttributeParserTests: XCTestCase {
3636

3737
func testParserOrder() {
3838
let parser = XMLParser.ValueParser()

SwiftDrawTests/CGRenderer.PathTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class CGRendererPathTests: XCTestCase {
35+
final class CGRendererPathTests: XCTestCase {
3636

3737
typealias Point = Builder.Point
3838

SwiftDrawTests/CoordinateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class CoordinateTests: XCTestCase {
35+
final class CoordinateTests: XCTestCase {
3636

3737
func testPrecisionMax() {
3838
var f = XMLFormatter.CoordinateFormatter()
File renamed without changes.

SwiftDrawTests/DOM.ElementTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class DOMElementTests: XCTestCase {
35+
final class DOMElementTests: XCTestCase {
3636

3737
func testLine() {
3838
let element = DOM.createLine()

SwiftDrawTests/ElementTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class ElementTests: XCTestCase {
35+
final class ElementTests: XCTestCase {
3636

3737
func testLine() {
3838
let node = ["x1": "0",

SwiftDrawTests/GradientTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class GradientTests: XCTestCase {
35+
final class GradientTests: XCTestCase {
3636

3737
func testLinerGradient() {
3838
let node = XML.Element(name: "linearGradient")

SwiftDrawTests/ImageTests.swift

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
2-
// ImageTests.swift
2+
// ScannerTests.swift
33
// SwiftDraw
44
//
5-
// Created by Simon Whitty on 3/3/17.
6-
// Copyright 2017 Simon Whitty
5+
// Created by Simon Whitty on 19/11/18.
6+
// Copyright 2018 Simon Whitty
77
//
88
// Distributed under the permissive zlib license
99
// Get the latest version from here:
@@ -29,64 +29,11 @@
2929
// 3. This notice may not be removed or altered from any source distribution.
3030
//
3131

32-
33-
import Foundation
34-
3532
import XCTest
3633
@testable import SwiftDraw
3734

38-
extension CGImage {
39-
static func from(data: Data) -> CGImage? {
40-
#if os(iOS)
41-
return UIImage(data: data)?.cgImage
42-
#elseif os(macOS)
43-
guard let image = NSImage(data: data) else { return nil }
44-
var rect = NSRect(x: 0, y: 0, width: image.size.width, height: image.size.height)
45-
return image.cgImage(forProposedRect: &rect, context: nil, hints: nil)
46-
#endif
47-
}
48-
}
49-
50-
class ImageTests: XCTestCase {
51-
52-
func testImage() throws {
53-
var node = ["xlink:href": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="]
54-
node["width"] = "10"
55-
node["height"] = "10"
56-
57-
let image = try XMLParser().parseImage(node)
58-
59-
XCTAssertTrue(image.href.isDataURL)
60-
61-
let decode = image.href.decodedData!
62-
63-
XCTAssertEqual(decode.mimeType, "image/png")
64-
65-
let cgImage = CGImage.from(data: decode.data)
66-
67-
XCTAssertNotNil(cgImage)
68-
XCTAssertEqual(cgImage?.width, 5)
69-
XCTAssertEqual(cgImage?.height, 5)
70-
}
71-
72-
func testImageLineBreaks() throws {
73-
let base64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblA " + "\n" +
74-
" AAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
35+
final class ImageTests: XCTestCase {
7536

76-
let node = ["xlink:href": base64, "width": "10", "height": "10"]
77-
78-
let image = try XMLParser().parseImage(node)
79-
80-
XCTAssertTrue(image.href.isDataURL)
81-
82-
let decode = image.href.decodedData!
83-
84-
XCTAssertEqual(decode.mimeType, "image/png")
85-
86-
let cgImage = CGImage.from(data: decode.data)
87-
88-
XCTAssertNotNil(cgImage)
89-
XCTAssertEqual(cgImage?.width, 5)
90-
XCTAssertEqual(cgImage?.height, 5)
37+
func testIsEOF() throws {
9138
}
9239
}

SwiftDrawTests/LayerTree.ColorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import XCTest
3333
@testable import SwiftDraw
3434

35-
class LayerTreeColorTests: XCTestCase {
35+
final class LayerTreeColorTests: XCTestCase {
3636

3737
typealias Color = LayerTree.Color
3838

0 commit comments

Comments
 (0)