Skip to content

Commit 8ebb6bf

Browse files
[6.0][Test-only] Don't use invalid module to satisfy canImport check (#7647) (#7678)
Explanation: This is a test-only change to allow for `canImport` change swiftlang/swift#74519 Scope: Test only. Update a test that relies on an invalid module as test input. Replace that with a swiftinterface. Original PR: #7647 Test: Unit-Test Reviewer: @tshortli
1 parent 08ace3d commit 8ebb6bf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Tests/SPMBuildCoreTests/PluginInvocationTests.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,11 +1044,14 @@ final class PluginInvocationTests: XCTestCase {
10441044
}
10451045
""")
10461046

1047-
// Create something that looks like another module that can be detected via `canImport()`.
1047+
// Create a valid swift interface file that can be detected via `canImport()`.
10481048
let fakeExtraModulesDir = tmpPath.appending("ExtraModules")
10491049
try localFileSystem.createDirectory(fakeExtraModulesDir, recursive: true)
1050-
let fakeExtraModuleFile = fakeExtraModulesDir.appending("ModuleFoundViaExtraSearchPaths.swiftmodule")
1051-
try localFileSystem.writeFileContents(fakeExtraModuleFile, string: "")
1050+
let fakeExtraModuleFile = fakeExtraModulesDir.appending("ModuleFoundViaExtraSearchPaths.swiftinterface")
1051+
try localFileSystem.writeFileContents(fakeExtraModuleFile, string: """
1052+
// swift-interface-format-version: 1.0
1053+
// swift-module-flags: -module-name ModuleFoundViaExtraSearchPaths
1054+
""")
10521055

10531056
/////////
10541057
// Load a workspace from the package.

0 commit comments

Comments
 (0)