From 13bc88133226258bb7435a6f1ddeb1402326c25f Mon Sep 17 00:00:00 2001 From: Ariel Elkin Date: Wed, 4 Sep 2024 12:58:44 +0200 Subject: [PATCH] lint --- Demos/Demo-iOS/Demo-iOS/AppDelegate.swift | 7 +- .../GrayscaleTigerViewController.swift | 13 +- .../Demo-iOS/IcelandicViewController.swift | 30 ++- .../Demo-iOS/MainViewController.swift | 64 +++--- .../Demo-iOS/RectangleViewController.swift | 7 +- .../Demo-iOS/SimpleDetailViewController.swift | 12 +- Demos/Demo-macOS/Demo-macOS/MacDemo.swift | 4 +- Package.swift | 9 +- Tests/PocketSVGTests.swift | 182 +++++++++--------- 9 files changed, 157 insertions(+), 171 deletions(-) diff --git a/Demos/Demo-iOS/Demo-iOS/AppDelegate.swift b/Demos/Demo-iOS/Demo-iOS/AppDelegate.swift index 661bccfc..6aed27d9 100644 --- a/Demos/Demo-iOS/Demo-iOS/AppDelegate.swift +++ b/Demos/Demo-iOS/Demo-iOS/AppDelegate.swift @@ -8,16 +8,15 @@ import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - + func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) let rootViewController = UINavigationController(rootViewController: MainViewController()) window?.rootViewController = rootViewController window?.makeKeyAndVisible() - + return true } } diff --git a/Demos/Demo-iOS/Demo-iOS/GrayscaleTigerViewController.swift b/Demos/Demo-iOS/Demo-iOS/GrayscaleTigerViewController.swift index 980b970f..6349c0d0 100644 --- a/Demos/Demo-iOS/Demo-iOS/GrayscaleTigerViewController.swift +++ b/Demos/Demo-iOS/Demo-iOS/GrayscaleTigerViewController.swift @@ -6,11 +6,10 @@ * file that was distributed with this source code. */ -import UIKit import PocketSVG +import UIKit class GrayscaleTigerViewController: UIViewController { - override func viewDidLoad() { super.viewDidLoad() @@ -22,17 +21,14 @@ class GrayscaleTigerViewController: UIViewController { let tigerLayer = CALayer() for (index, path) in paths.enumerated() { - let shapeLayer = CAShapeLayer() shapeLayer.path = path.cgPath - if index%2 == 0 { + if index % 2 == 0 { shapeLayer.fillColor = UIColor.black.cgColor - } - else if index%3 == 0 { + } else if index % 3 == 0 { shapeLayer.fillColor = UIColor.darkGray.cgColor - } - else { + } else { shapeLayer.fillColor = UIColor.gray.cgColor } @@ -46,4 +42,3 @@ class GrayscaleTigerViewController: UIViewController { view.layer.addSublayer(tigerLayer) } } - diff --git a/Demos/Demo-iOS/Demo-iOS/IcelandicViewController.swift b/Demos/Demo-iOS/Demo-iOS/IcelandicViewController.swift index 07a789f2..77c0d09f 100644 --- a/Demos/Demo-iOS/Demo-iOS/IcelandicViewController.swift +++ b/Demos/Demo-iOS/Demo-iOS/IcelandicViewController.swift @@ -6,29 +6,27 @@ * file that was distributed with this source code. */ -import UIKit import PocketSVG +import UIKit class IcelandicViewController: UIViewController { - let icelandicView = UIView() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white - + let svgURL = Bundle.main.url(forResource: "iceland", withExtension: "svg")! let paths = SVGBezierPath.pathsFromSVG(at: svgURL) - + for (index, path) in paths.enumerated() { - // assign different colours to different shapes: let shapeLayer = CAShapeLayer() - shapeLayer.fillColor = UIColor(hue: CGFloat(index)/CGFloat(paths.count), saturation: 1, brightness: 1, alpha: 1).cgColor - shapeLayer.strokeColor = UIColor(white: 1-CGFloat(index)/CGFloat(paths.count), alpha: 1).cgColor + shapeLayer.fillColor = UIColor(hue: CGFloat(index) / CGFloat(paths.count), saturation: 1, brightness: 1, alpha: 1).cgColor + shapeLayer.strokeColor = UIColor(white: 1 - CGFloat(index) / CGFloat(paths.count), alpha: 1).cgColor shapeLayer.path = path.cgPath icelandicView.layer.addSublayer(shapeLayer) - + // animate stroke width: let animation = CABasicAnimation(keyPath: "lineWidth") animation.toValue = 4 @@ -40,26 +38,26 @@ class IcelandicViewController: UIViewController { animation.isRemovedOnCompletion = false shapeLayer.add(animation, forKey: animation.keyPath) } - + let r = SVGBoundingRectForPaths(paths) icelandicView.frame = r - + let scrollview = UIScrollView(frame: view.bounds) scrollview.maximumZoomScale = 5.0 scrollview.minimumZoomScale = 0.5 - + scrollview.contentSize = r.size - + scrollview.delegate = self - + scrollview.addSubview(icelandicView) - + view.addSubview(scrollview) } } extension IcelandicViewController: UIScrollViewDelegate { - func viewForZooming(in scrollView: UIScrollView) -> UIView? { - return icelandicView + func viewForZooming(in _: UIScrollView) -> UIView? { + icelandicView } } diff --git a/Demos/Demo-iOS/Demo-iOS/MainViewController.swift b/Demos/Demo-iOS/Demo-iOS/MainViewController.swift index 99772bc0..342b0e15 100644 --- a/Demos/Demo-iOS/Demo-iOS/MainViewController.swift +++ b/Demos/Demo-iOS/Demo-iOS/MainViewController.swift @@ -9,7 +9,6 @@ import UIKit class MainViewController: UIViewController { - override func viewDidLoad() { super.viewDidLoad() title = "PocketSVG Demo" @@ -22,6 +21,7 @@ class MainViewController: UIViewController { view.addSubview(tableView) } } + enum Section: Int { case simple case complex @@ -29,13 +29,14 @@ enum Section: Int { var title: String { switch self { case .simple: - return "Simple" + "Simple" case .complex: - return "Complex" + "Complex" } } + static var count: Int { - return 2 + 2 } } @@ -48,40 +49,40 @@ enum SimpleRow: Int { case tiger static var count: Int { - return 4 + 4 } var svgURL: URL { switch self { case .circle: - return Bundle.main.url(forResource: "circle", withExtension: "svg")! + Bundle.main.url(forResource: "circle", withExtension: "svg")! case .curve: - return Bundle.main.url(forResource: "curve", withExtension: "svg")! + Bundle.main.url(forResource: "curve", withExtension: "svg")! case .lines: - return Bundle.main.url(forResource: "lines", withExtension: "svg")! + Bundle.main.url(forResource: "lines", withExtension: "svg")! case .attribute_inheritance: - return Bundle.main.url(forResource: "attribute_inheritance", withExtension: "svg")! + Bundle.main.url(forResource: "attribute_inheritance", withExtension: "svg")! case .iceland: - return Bundle.main.url(forResource: "iceland", withExtension: "svg")! + Bundle.main.url(forResource: "iceland", withExtension: "svg")! case .tiger: - return Bundle.main.url(forResource: "tiger", withExtension: "svg")! + Bundle.main.url(forResource: "tiger", withExtension: "svg")! } } var title: String { switch self { case .circle: - return "Circle" + "Circle" case .curve: - return "Curve" + "Curve" case .lines: - return "Lines" + "Lines" case .attribute_inheritance: - return "Attribute Inheritance" + "Attribute Inheritance" case .iceland: - return "Iceland" + "Iceland" case .tiger: - return "Tiger" + "Tiger" } } } @@ -92,23 +93,22 @@ enum ComplexRow: Int { case grayscaleTiger static var count: Int { - return 3 + 3 } var title: String { switch self { case .rectangle: - return "Rectangle" + "Rectangle" case .icelandic: - return "Icelandic" + "Icelandic" case .grayscaleTiger: - return "Grayscale Tiger" + "Grayscale Tiger" } } } extension MainViewController: UITableViewDataSource { - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "identifier", for: indexPath) @@ -125,11 +125,11 @@ extension MainViewController: UITableViewDataSource { return cell } - func numberOfSections(in tableView: UITableView) -> Int { - return Section.count + func numberOfSections(in _: UITableView) -> Int { + Section.count } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int { let sectionEnum = Section(rawValue: section)! switch sectionEnum { case .simple: @@ -139,20 +139,17 @@ extension MainViewController: UITableViewDataSource { } } - func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + func tableView(_: UITableView, titleForHeaderInSection section: Int) -> String? { let sectionEnum = Section(rawValue: section)! return sectionEnum.title } } extension MainViewController: UITableViewDelegate { - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let section = Section(rawValue: indexPath.section)! switch section { - case .simple: let row = SimpleRow(rawValue: indexPath.row)! let svgURL = row.svgURL @@ -161,14 +158,13 @@ extension MainViewController: UITableViewDelegate { case .complex: let row = ComplexRow(rawValue: indexPath.row)! - let vc: UIViewController - switch row { + let vc: UIViewController = switch row { case .rectangle: - vc = RectangleViewController() + RectangleViewController() case .icelandic: - vc = IcelandicViewController() + IcelandicViewController() case .grayscaleTiger: - vc = GrayscaleTigerViewController() + GrayscaleTigerViewController() } navigationController?.pushViewController(vc, animated: true) } diff --git a/Demos/Demo-iOS/Demo-iOS/RectangleViewController.swift b/Demos/Demo-iOS/Demo-iOS/RectangleViewController.swift index 8a09aa04..260c59c6 100644 --- a/Demos/Demo-iOS/Demo-iOS/RectangleViewController.swift +++ b/Demos/Demo-iOS/Demo-iOS/RectangleViewController.swift @@ -6,11 +6,10 @@ * file that was distributed with this source code. */ -import UIKit import PocketSVG +import UIKit class RectangleViewController: UIViewController { - override func viewDidLoad() { super.viewDidLoad() @@ -18,12 +17,12 @@ class RectangleViewController: UIViewController { let svgURL = Bundle.main.url(forResource: "rectangle", withExtension: "svg")! - let svgImageView = SVGImageView.init(contentsOf: svgURL) + let svgImageView = SVGImageView(contentsOf: svgURL) // The original SVG's stroke color is yellow, but we'll make it red: svgImageView.strokeColor = .red - //The original SVG's fill is transparent but we'll make it blue: + // The original SVG's fill is transparent but we'll make it blue: svgImageView.fillColor = .blue svgImageView.frame = view.bounds diff --git a/Demos/Demo-iOS/Demo-iOS/SimpleDetailViewController.swift b/Demos/Demo-iOS/Demo-iOS/SimpleDetailViewController.swift index cae1a8b6..e9bc9090 100644 --- a/Demos/Demo-iOS/Demo-iOS/SimpleDetailViewController.swift +++ b/Demos/Demo-iOS/Demo-iOS/SimpleDetailViewController.swift @@ -1,22 +1,21 @@ // -// DetailViewController.swift +// SimpleDetailViewController.swift // Demo-iOS // // Created by Ariel Elkin on 04/04/2018. // Copyright © 2018 PocketSVG. All rights reserved. // -import UIKit import PocketSVG +import UIKit class SimpleDetailViewController: UIViewController { - init(svgURL: URL) { super.init(nibName: nil, bundle: nil) view.backgroundColor = .white - let svgImageView = SVGImageView.init(contentsOf: svgURL) + let svgImageView = SVGImageView(contentsOf: svgURL) svgImageView.contentMode = .scaleAspectFit view.addSubview(svgImageView) @@ -26,11 +25,12 @@ class SimpleDetailViewController: UIViewController { svgImageView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -12), svgImageView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 12), svgImageView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -12), - ] + ] ) } - required init?(coder aDecoder: NSCoder) { + @available(*, unavailable) + required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } } diff --git a/Demos/Demo-macOS/Demo-macOS/MacDemo.swift b/Demos/Demo-macOS/Demo-macOS/MacDemo.swift index 5d23f2a8..d900e382 100644 --- a/Demos/Demo-macOS/Demo-macOS/MacDemo.swift +++ b/Demos/Demo-macOS/Demo-macOS/MacDemo.swift @@ -9,13 +9,13 @@ import Cocoa import PocketSVG -@NSApplicationMain +@main class AppDelegate: NSObject, NSApplicationDelegate {} class DemoController: NSViewController { override func loadView() { let url = Bundle.main.url(forResource: "iceland", withExtension: "svg")! - let j = SVGImageView.init(contentsOf: url) + let j = SVGImageView(contentsOf: url) print(j.viewBox == .null) view = j diff --git a/Package.swift b/Package.swift index 482135e0..09fe9bef 100644 --- a/Package.swift +++ b/Package.swift @@ -8,12 +8,13 @@ let package = Package( .macOS(.v10_10), .iOS(.v9), .tvOS(.v10), - .watchOS(.v3) + .watchOS(.v3), ], products: [ .library( name: "PocketSVG", - targets: ["PocketSVG"]) + targets: ["PocketSVG"] + ), ], dependencies: [ ], @@ -31,9 +32,9 @@ let package = Package( dependencies: ["PocketSVG"], path: "Tests", resources: [ - .process("Resources") + .process("Resources"), ] - ) + ), ], cxxLanguageStandard: .cxx14 ) diff --git a/Tests/PocketSVGTests.swift b/Tests/PocketSVGTests.swift index fa421ad3..7d495faf 100644 --- a/Tests/PocketSVGTests.swift +++ b/Tests/PocketSVGTests.swift @@ -6,13 +6,11 @@ * file that was distributed with this source code. */ - -import XCTest import Foundation import PocketSVG +import XCTest class PocketSVGTests: XCTestCase { - override func setUp() { super.setUp() continueAfterFailure = false @@ -23,7 +21,7 @@ class PocketSVGTests: XCTestCase { let paths = SVGBezierPath.pathsFromSVG(at: svgURL) - //this is just a rectangle shape, so we should have just one path: + // this is just a rectangle shape, so we should have just one path: XCTAssert(paths.count == 1) let rectanglePath = paths[0] @@ -37,37 +35,37 @@ class PocketSVGTests: XCTestCase { XCTAssert(rectanglePath.svgAttributes["width"] as! String == "100px") XCTAssert(rectanglePath.svgAttributes["height"] as! String == "100px") } - #if os(iOS) - func testPathsFromTiger() { - let svgURL = Bundle.module.url(forResource: "test_tiger", withExtension: "svg")! - let paths = SVGBezierPath.pathsFromSVG(at: svgURL) - - XCTAssert(paths.count == 240) - - let firstPath = UIBezierPath() - firstPath.move(to: CGPoint(x: -122.30000305175781, y: 84.285003662109375)) - firstPath.addCurve(to: CGPoint(x: -123.0300030708313, y: 86.160003662109375), controlPoint1: CGPoint(x: -122.30000305175781, y: 84.285003662109375), controlPoint2: CGPoint(x: -122.2000030502677, y: 86.179003715515137)) - firstPath.addCurve(to: CGPoint(x: -160.83000230789185, y: 40.309001922607422), controlPoint1: CGPoint(x: -123.85000306367874, y: 86.141003662720323), controlPoint2: CGPoint(x: -140.30000352859497, y: 38.066001892089844)) - firstPath.addCurve(to: CGPoint(x: -122.30000352859497, y: 84.285003662109375), controlPoint1: CGPoint(x: -160.83000230789185, y: 40.309001922607422), controlPoint2: CGPoint(x: -143.05000162124634, y: 32.956001758575439)) - firstPath.close() - XCTAssertEqual(firstPath.cgPath, paths[0].cgPath) - - let hundredthPath = UIBezierPath() - hundredthPath.move(to: CGPoint(x: 294.5, y: 153)) - hundredthPath.addCurve(to: CGPoint(x: 242, y: 123), controlPoint1: CGPoint(x: 294.5, y: 153), controlPoint2: CGPoint(x: 249.5, y: 124.5)) - hundredthPath.addCurve(to: CGPoint(x: 296.5, y: 162.5), controlPoint1: CGPoint(x: 230.1899995803833, y: 120.64000010490417), controlPoint2: CGPoint(x: 291.5, y: 152)) - hundredthPath.addCurve(to: CGPoint(x: 294.5, y: 153), controlPoint1: CGPoint(x: 296.5, y: 162.5), controlPoint2: CGPoint(x: 298.5, y: 160)) - hundredthPath.close() - XCTAssertEqual(hundredthPath.cgPath, paths[100].cgPath) - } + #if os(iOS) + func testPathsFromTiger() { + let svgURL = Bundle.module.url(forResource: "test_tiger", withExtension: "svg")! + let paths = SVGBezierPath.pathsFromSVG(at: svgURL) + + XCTAssert(paths.count == 240) + + let firstPath = UIBezierPath() + firstPath.move(to: CGPoint(x: -122.30000305175781, y: 84.285003662109375)) + firstPath.addCurve(to: CGPoint(x: -123.0300030708313, y: 86.160003662109375), controlPoint1: CGPoint(x: -122.30000305175781, y: 84.285003662109375), controlPoint2: CGPoint(x: -122.2000030502677, y: 86.179003715515137)) + firstPath.addCurve(to: CGPoint(x: -160.83000230789185, y: 40.309001922607422), controlPoint1: CGPoint(x: -123.85000306367874, y: 86.141003662720323), controlPoint2: CGPoint(x: -140.30000352859497, y: 38.066001892089844)) + firstPath.addCurve(to: CGPoint(x: -122.30000352859497, y: 84.285003662109375), controlPoint1: CGPoint(x: -160.83000230789185, y: 40.309001922607422), controlPoint2: CGPoint(x: -143.05000162124634, y: 32.956001758575439)) + firstPath.close() + XCTAssertEqual(firstPath.cgPath, paths[0].cgPath) + + let hundredthPath = UIBezierPath() + hundredthPath.move(to: CGPoint(x: 294.5, y: 153)) + hundredthPath.addCurve(to: CGPoint(x: 242, y: 123), controlPoint1: CGPoint(x: 294.5, y: 153), controlPoint2: CGPoint(x: 249.5, y: 124.5)) + hundredthPath.addCurve(to: CGPoint(x: 296.5, y: 162.5), controlPoint1: CGPoint(x: 230.1899995803833, y: 120.64000010490417), controlPoint2: CGPoint(x: 291.5, y: 152)) + hundredthPath.addCurve(to: CGPoint(x: 294.5, y: 153), controlPoint1: CGPoint(x: 296.5, y: 162.5), controlPoint2: CGPoint(x: 298.5, y: 160)) + hundredthPath.close() + XCTAssertEqual(hundredthPath.cgPath, paths[100].cgPath) + } #endif func testSVGRepresentationWhenUsingSettingSVGAttributes() { let attributes: [String: Any] = [ "stroke": "black", "stroke-width": "2", - "fill": "transparent" + "fill": "transparent", ] let bezierPath = SVGBezierPath().settingSVGAttributes(attributes) @@ -81,7 +79,7 @@ class PocketSVGTests: XCTestCase { let attributes: [String: Any] = [ "stroke": "black", "stroke-width": "2", - "fill": "transparent" + "fill": "transparent", ] let bezierPath = SVGBezierPath().settingSVGAttributes(attributes) @@ -105,17 +103,17 @@ class PocketSVGTests: XCTestCase { func testIgnoresMaskElement() { let svgString = """ - - - - - - - - - - - """ + + + + + + + + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) XCTAssertEqual(paths.count, 1) @@ -125,8 +123,8 @@ class PocketSVGTests: XCTestCase { } #if os(iOS) - func testRespectsAttributesOnAElement() { - let svgString = """ + func testRespectsAttributesOnAElement() { + let svgString = """ @@ -134,81 +132,81 @@ class PocketSVGTests: XCTestCase { """ - let paths = SVGBezierPath.paths(fromSVGString: svgString) - XCTAssertEqual(paths.count, 1) - let path = paths.first! + let paths = SVGBezierPath.paths(fromSVGString: svgString) + XCTAssertEqual(paths.count, 1) + let path = paths.first! - let pathTransform = (path.svgAttributes["transform"]! as! NSValue).cgAffineTransformValue - let pathBounds = path.bounds - let translatedPathBounds = pathBounds.applying(pathTransform) + let pathTransform = (path.svgAttributes["transform"]! as! NSValue).cgAffineTransformValue + let pathBounds = path.bounds + let translatedPathBounds = pathBounds.applying(pathTransform) - XCTAssertEqual(pathTransform, CGAffineTransform(translationX: 5, y: 10)) - XCTAssertEqual(pathBounds, CGRect(x: 15, y: 10, width: 60, height: 60)) - XCTAssertEqual(translatedPathBounds, CGRect(x: 20, y: 20, width: 60, height: 60)) - } + XCTAssertEqual(pathTransform, CGAffineTransform(translationX: 5, y: 10)) + XCTAssertEqual(pathBounds, CGRect(x: 15, y: 10, width: 60, height: 60)) + XCTAssertEqual(translatedPathBounds, CGRect(x: 20, y: 20, width: 60, height: 60)) + } #endif func testTransformTranslate() { let svgString = """ - - - - - - """ + + + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) XCTAssertEqual(paths.count, 1) let path = paths.first! - let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform(); + let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform() XCTAssertEqual(pathTransform, CGAffineTransform(translationX: 10, y: 5)) } func testTransformTranslateOptionalParameters() { let svgString = """ - - - - - - """ + + + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) XCTAssertEqual(paths.count, 1) let path = paths.first! - let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform(); + let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform() XCTAssertEqual(pathTransform, CGAffineTransform(translationX: 10, y: 0)) } func testTransformScale() { let svgString = """ - - - - - - """ + + + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) XCTAssertEqual(paths.count, 1) let path = paths.first! - let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform(); + let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform() XCTAssertEqual(pathTransform, CGAffineTransform(scaleX: 2, y: 2)) } func testTransformScaleOptionalParameters() { let svgString = """ - - - - - - """ + + + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) XCTAssertEqual(paths.count, 1) let path = paths.first! - let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform(); + let pathTransform = (path.svgAttributes["transform"]! as! NSValue).svg_CGAffineTransform() XCTAssertEqual(pathTransform, CGAffineTransform(scaleX: 2, y: 2)) } @@ -218,10 +216,10 @@ class PocketSVGTests: XCTestCase { */ func testBoundingBox() { let svgString = """ - - - - """ + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) XCTAssertEqual(paths.count, 1) let path = paths.first! @@ -234,15 +232,15 @@ class PocketSVGTests: XCTestCase { */ func testPathValuesWithLeadingZeros() throws { let svgString = """ - - - - """ + + + + """ let shortcutSvgString = """ - - - - """ + + + + """ let paths = SVGBezierPath.paths(fromSVGString: svgString) let cgPath = try XCTUnwrap(paths.first?.cgPath) let shortcutPaths = SVGBezierPath.paths(fromSVGString: shortcutSvgString)