File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,22 @@ import SKTestSupport
19
19
import SourceKitD
20
20
import XCTest
21
21
22
+ import class ISDBTibs. TibsBuilder
22
23
import struct TSCBasic. AbsolutePath
23
24
24
25
final class DiagnoseTests : XCTestCase {
26
+ /// If a default SDK is present on the test machine, return the `-sdk` argument that can be placed in the request
27
+ /// YAML. Otherwise, return an empty string.
28
+ private var sdkArg : String {
29
+ if let sdk = TibsBuilder . defaultSDKPath {
30
+ return """
31
+ " -sdk " , " \( sdk) " ,
32
+ """
33
+ } else {
34
+ return " "
35
+ }
36
+ }
37
+
25
38
func testRemoveCodeItemsAndMembers( ) async throws {
26
39
// We consider the test case reproducing if cursor info returns the two ambiguous results including their doc
27
40
// comments.
@@ -55,7 +68,8 @@ final class DiagnoseTests: XCTestCase {
55
68
{
56
69
key.request: source.request.cursorinfo,
57
70
key.compilerargs: [
58
- " $FILE "
71
+ " $FILE " ,
72
+ \( sdkArg)
59
73
],
60
74
key.offset: $OFFSET,
61
75
key.sourcefile: " $FILE "
@@ -102,7 +116,8 @@ final class DiagnoseTests: XCTestCase {
102
116
{
103
117
key.request: source.request.cursorinfo,
104
118
key.compilerargs: [
105
- " $FILE "
119
+ " $FILE " ,
120
+ \( sdkArg)
106
121
],
107
122
key.offset: $OFFSET,
108
123
key.sourcefile: " $FILE "
You can’t perform that action at this time.
0 commit comments