Skip to content

Commit 9a62899

Browse files
committed
Add Swift 6.2
1 parent aace30e commit 9a62899

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
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_9 = "5.9"
2019
case v5_10 = "5.10"
2120
case v6_0 = "6.0"
2221
case v6_1 = "6.1"
22+
case v6_2 = "6.2"
2323

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

Tests/SPIManifestTests/ManifestTests.swift

Lines changed: 14 additions & 14 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.9")
134+
swiftVersion: "5.10")
135135
]))
136136

137137
// MUT
138-
XCTAssertNotNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_9)))
138+
XCTAssertNotNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_10)))
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_9)))
147+
XCTAssertNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_10)))
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_9)))
157+
XCTAssertNil(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_10)))
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.9", scheme: "scheme-2")
163+
.init(platform: Platform.iOS.rawValue, swiftVersion: "5.10", scheme: "scheme-2")
164164
]))
165165

166166
// MUT
167-
XCTAssertEqual(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_9))?.scheme, "scheme-2")
167+
XCTAssertEqual(m.config(platform: .specific(.iOS), swiftVersion: .specific(.v5_10))?.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.9", scheme: "scheme-1"),
187+
.init(platform: Platform.iOS.rawValue, swiftVersion: "5.10", scheme: "scheme-1"),
188188
.init(platform: Platform.iOS.rawValue, scheme: "scheme-2")
189189
]))
190190

191191
// MUT
192-
XCTAssertEqual(m.config(swiftVersion: .specific(.v5_9))?.scheme, "scheme-1")
192+
XCTAssertEqual(m.config(swiftVersion: .specific(.v5_10))?.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.9
257+
swift_version: 5.10
258258
"""
259259
)
260260

261261
for s in SwiftVersion.allCases {
262262
for p in Platform.allCases {
263-
if p == .macosSpm && s == .v5_9 {
263+
if p == .macosSpm && s == .v5_10 {
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.9
285+
swift_version: 5.10
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_9):
294+
case (.iOS, .latestRelease), (.macosSpm, .v5_10):
295295
XCTAssertEqual(
296296
m.documentationTargets(platform: p, swiftVersion: s), ["t0"],
297297
"failed for (\(p), \(s))"
@@ -322,7 +322,7 @@ class ManifestTests: XCTestCase {
322322
documentation_targets:
323323
- t2
324324
- platform: watchos
325-
swift_version: 5.9
325+
swift_version: 5.10
326326
documentation_targets:
327327
- t3
328328
"""
@@ -338,7 +338,7 @@ class ManifestTests: XCTestCase {
338338
XCTAssertEqual(m.documentationTargets(platform: platform, swiftVersion: swiftVersion), ["t1"])
339339
case (.watchOS, .v6_1):
340340
XCTAssertEqual(m.documentationTargets(platform: platform, swiftVersion: swiftVersion), ["t2"])
341-
case (.watchOS, .v5_9):
341+
case (.watchOS, .v5_10):
342342
XCTAssertEqual(m.documentationTargets(platform: platform, swiftVersion: swiftVersion), ["t3"])
343343
default:
344344
XCTAssertEqual(m.documentationTargets(platform: platform, swiftVersion: swiftVersion), nil)

Tests/SPIManifestTests/SwiftVersionTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ import XCTest
1919
class SwiftVersionTests: XCTestCase {
2020

2121
func test_init() throws {
22-
XCTAssertEqual(SwiftVersion(major: 5, minor: 9), .v5_9)
22+
XCTAssertEqual(SwiftVersion(major: 5, minor: 10), .v5_10)
2323
XCTAssertEqual(SwiftVersion(major: 5, minor: 5), nil)
2424
}
2525

2626
func test_isLatestRelease() throws {
27-
XCTAssertEqual(SwiftVersion.v5_9.isLatestRelease, false)
2827
XCTAssertEqual(SwiftVersion.v5_10.isLatestRelease, false)
2928
XCTAssertEqual(SwiftVersion.v6_0.isLatestRelease, false)
3029
XCTAssertEqual(SwiftVersion.v6_1.isLatestRelease, true)
30+
XCTAssertEqual(SwiftVersion.v6_2.isLatestRelease, false)
3131
}
3232

3333
func test_Comparable() throws {
34+
XCTAssert(SwiftVersion.v6_2 > .v6_1)
3435
XCTAssert(SwiftVersion.v6_1 > .v6_0)
3536
XCTAssert(SwiftVersion.v6_0 > .v5_10)
36-
XCTAssert(SwiftVersion.v5_10 > .v5_9)
3737
}
3838

3939
}

0 commit comments

Comments
 (0)