Skip to content

Commit 2b6aa1c

Browse files
Fix build for 6.0
1 parent 3fb7879 commit 2b6aa1c

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

Diff for: Examples/Testing/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 6.2
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

Diff for: Examples/Testing/Tests/CounterTests/CounterTests.swift

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import Testing
21
@testable import Counter
32

3+
#if canImport(Testing)
4+
import Testing
5+
46
@Test func increment() async throws {
57
var counter = Counter()
68
counter.increment()
@@ -13,3 +15,22 @@ import Testing
1315
counter.increment()
1416
#expect(counter.count == 2)
1517
}
18+
19+
#endif
20+
21+
import XCTest
22+
23+
class CounterTests: XCTestCase {
24+
func testIncrement() async {
25+
var counter = Counter()
26+
counter.increment()
27+
XCTAssertEqual(counter.count, 1)
28+
}
29+
30+
func testIncrementTwice() async {
31+
var counter = Counter()
32+
counter.increment()
33+
counter.increment()
34+
XCTAssertEqual(counter.count, 2)
35+
}
36+
}

Diff for: Examples/Testing/run-tests.mjs

-3
This file was deleted.

Diff for: Plugins/PackageToJS/PackagingPlanner.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct PackagingPlanner {
3737
/// Construct the build plan and return the root task key
3838
func planBuild(
3939
make: inout MiniMake,
40-
wasmProductArtifact: URL,
40+
wasmProductArtifact: URL
4141
) -> MiniMake.TaskKey {
4242
let (allTasks, _) = planBuildInternal(make: &make, wasmProductArtifact: wasmProductArtifact)
4343
return make.addTask(
@@ -47,7 +47,7 @@ struct PackagingPlanner {
4747

4848
private func planBuildInternal(
4949
make: inout MiniMake,
50-
wasmProductArtifact: URL,
50+
wasmProductArtifact: URL
5151
) -> (allTasks: [MiniMake.TaskKey], outputDirTask: MiniMake.TaskKey) {
5252
// Prepare output directory
5353
let outputDirTask = make.addTask(
@@ -109,7 +109,7 @@ struct PackagingPlanner {
109109
/// Construct the test build plan and return the root task key
110110
func planTestBuild(
111111
make: inout MiniMake,
112-
wasmProductArtifact: URL,
112+
wasmProductArtifact: URL
113113
) -> (rootTask: MiniMake.TaskKey, binDir: URL) {
114114
var (allTasks, outputDirTask) = planBuildInternal(make: &make, wasmProductArtifact: wasmProductArtifact)
115115

0 commit comments

Comments
 (0)