Skip to content

Commit 1fb2e65

Browse files
authored
Switch some let's to var's. (#189)
* Switch some let's to var's. * add xcodegen as a dependency
1 parent fd07b85 commit 1fb2e65

File tree

10 files changed

+637
-547
lines changed

10 files changed

+637
-547
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2
1+
4.2.1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
xcodeproj:
2-
xcodegen && xed .
2+
swift run xcodegen
33

44
test-linux:
55
docker build --tag snapshot-testing . \

Package.resolved

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,96 @@
11
{
22
"object": {
33
"pins": [
4-
4+
{
5+
"package": "AEXML",
6+
"repositoryURL": "https://github.com/tadija/AEXML",
7+
"state": {
8+
"branch": null,
9+
"revision": "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0",
10+
"version": "4.3.3"
11+
}
12+
},
13+
{
14+
"package": "JSONUtilities",
15+
"repositoryURL": "https://github.com/yonaskolb/JSONUtilities.git",
16+
"state": {
17+
"branch": null,
18+
"revision": "db238f4858ac2ac3fff228b5b71ce90488a6a9b3",
19+
"version": "4.1.0"
20+
}
21+
},
22+
{
23+
"package": "PathKit",
24+
"repositoryURL": "https://github.com/kylef/PathKit.git",
25+
"state": {
26+
"branch": null,
27+
"revision": "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0",
28+
"version": "0.9.2"
29+
}
30+
},
31+
{
32+
"package": "Rainbow",
33+
"repositoryURL": "https://github.com/onevcat/Rainbow.git",
34+
"state": {
35+
"branch": null,
36+
"revision": "797a68d0a642609424b08f11eb56974a54d5f6e2",
37+
"version": "3.1.4"
38+
}
39+
},
40+
{
41+
"package": "Spectre",
42+
"repositoryURL": "https://github.com/kylef/Spectre.git",
43+
"state": {
44+
"branch": null,
45+
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
46+
"version": "0.9.0"
47+
}
48+
},
49+
{
50+
"package": "SwiftCLI",
51+
"repositoryURL": "https://github.com/jakeheis/SwiftCLI.git",
52+
"state": {
53+
"branch": null,
54+
"revision": "5318c37d3cacc8780f50b87a8840a6774320ebdf",
55+
"version": "5.2.2"
56+
}
57+
},
58+
{
59+
"package": "SwiftShell",
60+
"repositoryURL": "https://github.com/kareman/SwiftShell",
61+
"state": {
62+
"branch": null,
63+
"revision": "beebe43c986d89ea5359ac3adcb42dac94e5e08a",
64+
"version": "4.1.2"
65+
}
66+
},
67+
{
68+
"package": "XcodeGen",
69+
"repositoryURL": "https://github.com/yonaskolb/XcodeGen.git",
70+
"state": {
71+
"branch": null,
72+
"revision": "b490851c737809ee3cb545ee8ea41742cfb5a84d",
73+
"version": "2.2.0"
74+
}
75+
},
76+
{
77+
"package": "xcodeproj",
78+
"repositoryURL": "https://github.com/tuist/xcodeproj.git",
79+
"state": {
80+
"branch": null,
81+
"revision": "8e15cc74149ee946b7ae125685177915b4ff7317",
82+
"version": "6.4.0"
83+
}
84+
},
85+
{
86+
"package": "Yams",
87+
"repositoryURL": "https://github.com/jpsim/Yams.git",
88+
"state": {
89+
"branch": null,
90+
"revision": "26ab35f50ea891e8edefcc9d975db2f6b67e1d68",
91+
"version": "1.0.1"
92+
}
93+
}
594
]
695
},
796
"version": 1

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ let package = Package(
1010
targets: ["SnapshotTesting"]),
1111
],
1212
dependencies: [
13+
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.2.0"),
1314
],
1415
targets: [
1516
.target(

SnapshotTesting.xcodeproj/project.pbxproj

Lines changed: 524 additions & 524 deletions
Large diffs are not rendered by default.

SnapshotTesting.xcodeproj/xcshareddata/xcschemes/SnapshotTesting_iOS.xcscheme

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
17+
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
1818
BuildableName = "SnapshotTesting.framework"
1919
BlueprintName = "SnapshotTesting_iOS"
2020
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -32,7 +32,7 @@
3232
skipped = "NO">
3333
<BuildableReference
3434
BuildableIdentifier = "primary"
35-
BlueprintIdentifier = "NT_3F877242DE1996BA0322ABCB069FB3D9"
35+
BlueprintIdentifier = "6C1340F5ED556C5C9B3AE6579E6A859C"
3636
BuildableName = "SnapshotTestingTests.xctest"
3737
BlueprintName = "SnapshotTestingTests_iOS"
3838
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -42,7 +42,7 @@
4242
<MacroExpansion>
4343
<BuildableReference
4444
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
45+
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
4646
BuildableName = "SnapshotTesting.framework"
4747
BlueprintName = "SnapshotTesting_iOS"
4848
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -73,7 +73,7 @@
7373
<MacroExpansion>
7474
<BuildableReference
7575
BuildableIdentifier = "primary"
76-
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
76+
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
7777
BuildableName = "SnapshotTesting.framework"
7878
BlueprintName = "SnapshotTesting_iOS"
7979
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -101,7 +101,7 @@
101101
runnableDebuggingMode = "0">
102102
<BuildableReference
103103
BuildableIdentifier = "primary"
104-
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
104+
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
105105
BuildableName = "SnapshotTesting.framework"
106106
BlueprintName = "SnapshotTesting_iOS"
107107
ReferencedContainer = "container:SnapshotTesting.xcodeproj">

SnapshotTesting.xcodeproj/xcshareddata/xcschemes/SnapshotTesting_macOS.xcscheme

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
17+
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
1818
BuildableName = "SnapshotTesting.framework"
1919
BlueprintName = "SnapshotTesting_macOS"
2020
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -32,7 +32,7 @@
3232
skipped = "NO">
3333
<BuildableReference
3434
BuildableIdentifier = "primary"
35-
BlueprintIdentifier = "NT_0640DAF50FBD76E0169F38B530ABB4E3"
35+
BlueprintIdentifier = "4D351C54668E3B5721A83752A850D9DE"
3636
BuildableName = "SnapshotTestingTests.xctest"
3737
BlueprintName = "SnapshotTestingTests_macOS"
3838
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -42,7 +42,7 @@
4242
<MacroExpansion>
4343
<BuildableReference
4444
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
45+
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
4646
BuildableName = "SnapshotTesting.framework"
4747
BlueprintName = "SnapshotTesting_macOS"
4848
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -73,7 +73,7 @@
7373
<MacroExpansion>
7474
<BuildableReference
7575
BuildableIdentifier = "primary"
76-
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
76+
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
7777
BuildableName = "SnapshotTesting.framework"
7878
BlueprintName = "SnapshotTesting_macOS"
7979
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -101,7 +101,7 @@
101101
runnableDebuggingMode = "0">
102102
<BuildableReference
103103
BuildableIdentifier = "primary"
104-
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
104+
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
105105
BuildableName = "SnapshotTesting.framework"
106106
BlueprintName = "SnapshotTesting_macOS"
107107
ReferencedContainer = "container:SnapshotTesting.xcodeproj">

SnapshotTesting.xcodeproj/xcshareddata/xcschemes/SnapshotTesting_tvOS.xcscheme

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
17+
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
1818
BuildableName = "SnapshotTesting.framework"
1919
BlueprintName = "SnapshotTesting_tvOS"
2020
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -32,7 +32,7 @@
3232
skipped = "NO">
3333
<BuildableReference
3434
BuildableIdentifier = "primary"
35-
BlueprintIdentifier = "NT_F155FA762896640C78950B0027F9917D"
35+
BlueprintIdentifier = "A6C32CCDA022766883A434A0E026CFA2"
3636
BuildableName = "SnapshotTestingTests.xctest"
3737
BlueprintName = "SnapshotTestingTests_tvOS"
3838
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -42,7 +42,7 @@
4242
<MacroExpansion>
4343
<BuildableReference
4444
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
45+
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
4646
BuildableName = "SnapshotTesting.framework"
4747
BlueprintName = "SnapshotTesting_tvOS"
4848
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -73,7 +73,7 @@
7373
<MacroExpansion>
7474
<BuildableReference
7575
BuildableIdentifier = "primary"
76-
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
76+
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
7777
BuildableName = "SnapshotTesting.framework"
7878
BlueprintName = "SnapshotTesting_tvOS"
7979
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
@@ -101,7 +101,7 @@
101101
runnableDebuggingMode = "0">
102102
<BuildableReference
103103
BuildableIdentifier = "primary"
104-
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
104+
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
105105
BuildableName = "SnapshotTesting.framework"
106106
BlueprintName = "SnapshotTesting_tvOS"
107107
ReferencedContainer = "container:SnapshotTesting.xcodeproj">

Sources/SnapshotTesting/Diffing.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import XCTest
44
/// The ability to compare `Value`s and convert them to and from `Data`.
55
public struct Diffing<Value> {
66
/// Converts a value _to_ data.
7-
public let toData: (Value) -> Data
7+
public var toData: (Value) -> Data
88

99
/// Produces a value _from_ data.
10-
public let fromData: (Data) -> Value
10+
public var fromData: (Data) -> Value
1111

1212
/// Compares two values. If the values do not match, returns a failure message and artifacts describing the failure.
13-
public let diff: (Value, Value) -> (String, [XCTAttachment])?
13+
public var diff: (Value, Value) -> (String, [XCTAttachment])?
1414

1515
/// Creates a new `Diffing` on `Value`.
1616
///

Sources/SnapshotTesting/Snapshotting.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ public struct Snapshotting<Value, Format> {
77
public var pathExtension: String?
88

99
/// How the snapshot format is diffed and converted to and from data.
10-
public let diffing: Diffing<Format>
10+
public var diffing: Diffing<Format>
1111

1212
/// How a value is transformed into a diffable snapshot format.
13-
public let snapshot: (Value) -> Async<Format>
13+
public var snapshot: (Value) -> Async<Format>
1414

1515
/// Creates a snapshot strategy.
1616
///

0 commit comments

Comments
 (0)