Skip to content

Commit ac6611f

Browse files
Merge pull request #39 from SwiftPackageIndex/swift-5.10
Add Swift 5.10
2 parents 49d1003 + 61d0218 commit ac6611f

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

Sources/SPIManifest/SwiftVersion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public typealias ShortVersion = String
1616

1717

1818
public enum SwiftVersion: ShortVersion, Codable, CaseIterable {
19-
case v5_6 = "5.6"
2019
case v5_7 = "5.7"
2120
case v5_8 = "5.8"
2221
case v5_9 = "5.9"
22+
case v5_10 = "5.10"
2323

2424
public static var latestRelease: Self { .v5_9 }
2525

Tests/SPIManifestTests/ManifestTests.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ class ManifestTests: XCTestCase {
131131
do { // match
132132
let m = Manifest(builder: .init(configs: [
133133
.init(platform: Platform.iOS.rawValue,
134-
swiftVersion: "5.6")
134+
swiftVersion: "5.9")
135135
]))
136136

137137
// MUT
138-
XCTAssertNotNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_6)))
138+
XCTAssertNotNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_9)))
139139
}
140140

141141
do { // no matching platform
@@ -144,7 +144,7 @@ class ManifestTests: XCTestCase {
144144
]))
145145

146146
// MUT
147-
XCTAssertNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_6)))
147+
XCTAssertNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_9)))
148148
}
149149

150150
do { // no matching version
@@ -154,17 +154,17 @@ class ManifestTests: XCTestCase {
154154
]))
155155

156156
// MUT
157-
XCTAssertNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_6)))
157+
XCTAssertNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_9)))
158158
}
159159

160160
do { // pick specific swift version over nil one
161161
let m = Manifest(builder: .init(configs: [
162162
.init(platform: Platform.iOS.rawValue, scheme: "scheme-1"),
163-
.init(platform: Platform.iOS.rawValue, swiftVersion: "5.6", scheme: "scheme-2")
163+
.init(platform: Platform.iOS.rawValue, swiftVersion: "5.9", scheme: "scheme-2")
164164
]))
165165

166166
// MUT
167-
XCTAssertEqual(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_6))?.scheme, "scheme-2")
167+
XCTAssertEqual(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_9))?.scheme, "scheme-2")
168168
}
169169
}
170170

@@ -184,12 +184,12 @@ class ManifestTests: XCTestCase {
184184
// Test `config` selector
185185
let m = Manifest(builder: .init(configs: [
186186
.init(platform: Platform.linux.rawValue),
187-
.init(platform: Platform.iOS.rawValue, swiftVersion: "5.6", scheme: "scheme-1"),
187+
.init(platform: Platform.iOS.rawValue, swiftVersion: "5.9", scheme: "scheme-1"),
188188
.init(platform: Platform.iOS.rawValue, scheme: "scheme-2")
189189
]))
190190

191191
// MUT
192-
XCTAssertEqual(m.config(swiftVersion: .specific(.v5_6))?.scheme, "scheme-1")
192+
XCTAssertEqual(m.config(swiftVersion: .specific(.v5_9))?.scheme, "scheme-1")
193193
}
194194

195195
func test_documentationTargets_bare_default() throws {
@@ -254,13 +254,13 @@ class ManifestTests: XCTestCase {
254254
builder:
255255
configs:
256256
- documentation_targets: [t0]
257-
swift_version: 5.6
257+
swift_version: 5.8
258258
"""
259259
)
260260

261261
for s in SwiftVersion.allCases {
262262
for p in Platform.allCases {
263-
if p == .macosSpm && s == .v5_6 {
263+
if p == .macosSpm && s == .v5_8 {
264264
XCTAssertEqual(
265265
m.documentationTargets(platform: p, swiftVersion: s), ["t0"],
266266
"failed for (\(p), \(s))"
@@ -282,7 +282,7 @@ class ManifestTests: XCTestCase {
282282
builder:
283283
configs:
284284
- documentation_targets: [t0]
285-
swift_version: 5.6
285+
swift_version: 5.8
286286
- documentation_targets: [t0]
287287
platform: ios
288288
"""
@@ -291,7 +291,7 @@ class ManifestTests: XCTestCase {
291291
for s in SwiftVersion.allCases {
292292
for p in Platform.allCases {
293293
switch (p, s) {
294-
case (.iOS, .latestRelease), (.macosSpm, .v5_6):
294+
case (.iOS, .latestRelease), (.macosSpm, .v5_8):
295295
XCTAssertEqual(
296296
m.documentationTargets(platform: p, swiftVersion: s), ["t0"],
297297
"failed for (\(p), \(s))"
@@ -330,9 +330,9 @@ class ManifestTests: XCTestCase {
330330

331331
// MUT
332332
XCTAssertEqual(m.documentationTargets(platform: .watchOS, swiftVersion: .v5_7), ["t3"])
333-
XCTAssertEqual(m.documentationTargets(platform: .watchOS, swiftVersion: .v5_6), nil)
334333
XCTAssertEqual(m.documentationTargets(platform: .macosSpm, swiftVersion: .v5_8), nil)
335334
XCTAssertEqual(m.documentationTargets(platform: .macosSpm, swiftVersion: .v5_9), ["t0"])
335+
XCTAssertEqual(m.documentationTargets(platform: .watchOS, swiftVersion: .v5_10), nil)
336336
}
337337

338338
func test_allDocumentationTargets() throws {

Tests/SPIManifestTests/SwiftVersionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class SwiftVersionTests: XCTestCase {
3030
}
3131

3232
func test_Comparable() throws {
33+
XCTAssert(SwiftVersion.v5_10 > .v5_9)
3334
XCTAssert(SwiftVersion.v5_9 > .v5_8)
3435
XCTAssert(SwiftVersion.v5_8 > .v5_7)
35-
XCTAssert(SwiftVersion.v5_7 > .v5_6)
3636
}
3737

3838
}

0 commit comments

Comments
 (0)