Skip to content

Commit

Permalink
Swift 4 (#54)
Browse files Browse the repository at this point in the history
* Swift 4 Experiment

* Test

* Test

* Bump

* Bump

* Fix
  • Loading branch information
stephencelis authored Mar 31, 2019
1 parent 296c377 commit 3ffc3fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Carthage/Checkouts/swift-snapshot-testing
Submodule swift-snapshot-testing updated 29 files
+1 −1 .circleci/config.yml
+64 −8 .gitignore
+1 −1 .swift-version
+1 −1 Dockerfile
+24 −11 Documentation/Available-Snapshot-Strategies.md
+1 −1 LICENSE
+3 −3 Makefile
+0 −97 Package.resolved
+10 −5 Package.swift
+6 −4 README.md
+2 −2 SnapshotTesting.podspec
+20 −0 SnapshotTesting.xcodeproj/project.pbxproj
+210 −0 Sources/SnapshotTesting/AssertInlineSnapshot.swift
+9 −7 Sources/SnapshotTesting/AssertSnapshot.swift
+0 −252 Sources/SnapshotTesting/SnapshotTestCase.swift
+6 −1 Sources/SnapshotTesting/Snapshotting/Any.swift
+2 −2 Sources/SnapshotTesting/Snapshotting/NSImage.swift
+2 −2 Sources/SnapshotTesting/Snapshotting/UIImage.swift
+70 −9 Sources/SnapshotTesting/Snapshotting/URLRequest.swift
+81 −7 Tests/SnapshotTestingTests/SnapshotTestingTests.swift
+ Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testMixedViews.macos.png
+ Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testNSView.1.png
+ Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testPrecision.macos.png
+4 −0 Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testURLRequest.get-curl.txt
+4 −0 Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testURLRequest.head-curl.txt
+2 −0 Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testURLRequest.head.txt
+6 −0 Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testURLRequest.post-curl.txt
+10 −0 Tests/SnapshotTestingTests/__Snapshots__/SnapshotTestingTests/testURLRequest.post-json.txt
+5 −2 project.yml
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:4.2
import Foundation
import PackageDescription

Expand All @@ -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(
Expand All @@ -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") {
Expand Down
2 changes: 2 additions & 0 deletions Sources/Html/Node.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ extension Node: ExpressibleByStringLiteral {
}
}

#if swift(>=5.0)
public struct NodeStringInterpolation: StringInterpolationProtocol {
var node: Node

Expand All @@ -160,3 +161,4 @@ extension Node: ExpressibleByStringInterpolation {
self = stringInterpolation.node
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3ffc3fc

Please sign in to comment.