Set -sdk in testCompletionUsingCompileFlagsTxt

Otherwise this test fails when run using an Xcode toolchain (instead of an open source toolchain).
This commit is contained in:
Alex Hoppen
2025-03-18 09:45:22 -07:00
parent b757fb9806
commit 4b30573d95

View File

@@ -1148,6 +1148,17 @@ final class SwiftCompletionTests: XCTestCase {
}
func testCompletionUsingCompileFlagsTxt() async throws {
let compileFlags =
if let defaultSDKPath {
"""
-DFOO
-sdk
\(defaultSDKPath)
"""
} else {
"-DFOO"
}
let project = try await MultiFileTestProject(
files: [
"test.swift": """
@@ -1160,7 +1171,7 @@ final class SwiftCompletionTests: XCTestCase {
print(myVar1⃣)
}
""",
"compile_flags.txt": "-DFOO",
"compile_flags.txt": compileFlags,
]
)
let (uri, positions) = try project.openDocument("test.swift")