mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user