From 3ffc3fc8feb5fde766f5f44fd06ebc030f0721f3 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Sun, 31 Mar 2019 13:41:49 -0400 Subject: [PATCH] Swift 4 (#54) * Swift 4 Experiment * Test * Test * Bump * Bump * Fix --- Carthage/Checkouts/swift-snapshot-testing | 2 +- Package.swift | 10 +++++++--- Sources/Html/Node.swift | 2 ++ .../HtmlSnapshotTestingTests.swift | 6 +----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Carthage/Checkouts/swift-snapshot-testing b/Carthage/Checkouts/swift-snapshot-testing index 1fb2e65..883f0b0 160000 --- a/Carthage/Checkouts/swift-snapshot-testing +++ b/Carthage/Checkouts/swift-snapshot-testing @@ -1 +1 @@ -Subproject commit 1fb2e65cf62d2f983b3cab2871cbb218ea9ee9b7 +Subproject commit 883f0b0623ae55f41f42e2399dab428017896448 diff --git a/Package.swift b/Package.swift index 5739ced..9f8053e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:4.2 import Foundation import PackageDescription @@ -13,7 +13,7 @@ let package = Package( targets: ["HtmlSnapshotTesting"]), ], dependencies: [ - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.3.0"), + .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.5.0"), ], targets: [ .target( @@ -28,7 +28,11 @@ let package = Package( .testTarget( name: "HtmlSnapshotTestingTests", dependencies: ["HtmlSnapshotTesting"]), - ] + ], + swiftLanguageVersions: [ + .version("5"), + .v4_2, + ] ) if ProcessInfo.processInfo.environment.keys.contains("PF_DEVELOP") { diff --git a/Sources/Html/Node.swift b/Sources/Html/Node.swift index 6eee9aa..ce02c52 100644 --- a/Sources/Html/Node.swift +++ b/Sources/Html/Node.swift @@ -135,6 +135,7 @@ extension Node: ExpressibleByStringLiteral { } } +#if swift(>=5.0) public struct NodeStringInterpolation: StringInterpolationProtocol { var node: Node @@ -160,3 +161,4 @@ extension Node: ExpressibleByStringInterpolation { self = stringInterpolation.node } } +#endif diff --git a/Tests/HtmlSnapshotTestingTests/HtmlSnapshotTestingTests.swift b/Tests/HtmlSnapshotTestingTests/HtmlSnapshotTestingTests.swift index 48f4ddb..3d2e523 100644 --- a/Tests/HtmlSnapshotTestingTests/HtmlSnapshotTestingTests.swift +++ b/Tests/HtmlSnapshotTestingTests/HtmlSnapshotTestingTests.swift @@ -3,11 +3,7 @@ import HtmlSnapshotTesting import SnapshotTesting import XCTest -#if !os(Linux) -typealias SnapshotTestCase = XCTestCase -#endif - -final class SnapshotTestingTests: SnapshotTestCase { +final class SnapshotTestingTests: XCTestCase { func testComplexHtml() { let doc: Node = .document( .html(