Skip to content

Commit ea8ffa6

Browse files
committed
Restore test cases and fix compile error
1 parent dab4036 commit ea8ffa6

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Tests/CommandsTests/CommandsTestCase.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class CommandsTestCase: XCTestCase {
3838
class CommandsBuildProviderTestCase: BuildSystemProviderTestCase {
3939
/// Original working directory before the test ran (if known).
4040
private var originalWorkingDirectory: AbsolutePath? = .none
41+
let duplicateSymbolRegex = StringPattern.regex(".*One of the duplicates must be removed or renamed.")
4142

4243
override func setUp() {
4344
originalWorkingDirectory = localFileSystem.currentWorkingDirectory

Tests/CommandsTests/RunCommandTests.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ class RunCommandTestCase: CommandsBuildProviderTestCase {
4848
XCTAssert(stdout.contains("SEE ALSO: swift build, swift package, swift test"), "got stdout:\n" + stdout)
4949
}
5050

51+
func testCommandDoesNotEmitDuplicateSymbols() async throws {
52+
let (stdout, stderr) = try await execute(["--help"])
53+
XCTAssertNoMatch(stdout, duplicateSymbolRegex)
54+
XCTAssertNoMatch(stderr, duplicateSymbolRegex)
55+
}
56+
5157
func testVersion() async throws {
5258
let stdout = try await execute(["--version"]).stdout
5359
XCTAssertMatch(stdout, .regex(#"Swift Package Manager -( \w+ )?\d+.\d+.\d+(-\w+)?"#))
@@ -262,6 +268,6 @@ class RunCommandSwiftBuildTests: RunCommandTestCase {
262268
}
263269

264270
override func testUnreachableExecutable() async throws {
265-
throw XCTSkip("SWBINTTODO: Test fails because of build layout differences.)
271+
throw XCTSkip("SWBINTTODO: Test fails because of build layout differences.")
266272
}
267273
}

Tests/CommandsTests/SwiftSDKCommandTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ final class SwiftSDKCommandTests: CommandsTestCase {
3232
}
3333
}
3434

35+
func testCommandDoesNotEmitDuplicateSymbols() async throws {
36+
for command in [SwiftPM.sdk, SwiftPM.experimentalSDK] {
37+
let (stdout, stderr) = try await command.execute(["--help"])
38+
XCTAssertNoMatch(stdout, duplicateSymbolRegex)
39+
XCTAssertNoMatch(stderr, duplicateSymbolRegex)
40+
}
41+
}
42+
3543
func testVersionS() async throws {
3644
for command in [SwiftPM.sdk, SwiftPM.experimentalSDK] {
3745
let stdout = try await command.execute(["--version"]).stdout

0 commit comments

Comments
 (0)