File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -1149,6 +1149,64 @@ final class DocumentTestDiscoveryTests: XCTestCase {
1149
1149
)
1150
1150
}
1151
1151
1152
+ func testSwiftTestingTwoExtensionsNoDeclaration( ) async throws {
1153
+ let testClient = try await TestSourceKitLSPClient ( )
1154
+ let uri = DocumentURI . for ( . swift)
1155
+
1156
+ let positions = testClient. openDocument (
1157
+ """
1158
+ import Testing
1159
+
1160
+ 1️⃣extension MyTests {
1161
+ 3️⃣@Test func oneIsTwo() {}4️⃣
1162
+ }2️⃣
1163
+
1164
+ extension MyTests {
1165
+ 5️⃣@Test func twoIsThree() {}6️⃣
1166
+ }
1167
+ """ ,
1168
+ uri: uri
1169
+ )
1170
+
1171
+ let tests = try await testClient. send ( DocumentTestsRequest ( textDocument: TextDocumentIdentifier ( uri) ) )
1172
+ XCTAssertEqual (
1173
+ tests,
1174
+ [
1175
+ TestItem (
1176
+ id: " MyTests " ,
1177
+ label: " MyTests " ,
1178
+ disabled: false ,
1179
+ isExtension: true ,
1180
+ style: TestStyle . swiftTesting,
1181
+ location: Location ( uri: uri, range: positions [ " 1️⃣ " ] ..< positions [ " 2️⃣ " ] ) ,
1182
+ children: [
1183
+ TestItem (
1184
+ id: " MyTests/oneIsTwo() " ,
1185
+ label: " oneIsTwo() " ,
1186
+ disabled: false ,
1187
+ isExtension: true ,
1188
+ style: TestStyle . swiftTesting,
1189
+ location: Location ( uri: uri, range: positions [ " 3️⃣ " ] ..< positions [ " 4️⃣ " ] ) ,
1190
+ children: [ ] ,
1191
+ tags: [ ]
1192
+ ) ,
1193
+ TestItem (
1194
+ id: " MyTests/twoIsThree() " ,
1195
+ label: " twoIsThree() " ,
1196
+ disabled: false ,
1197
+ isExtension: true ,
1198
+ style: TestStyle . swiftTesting,
1199
+ location: Location ( uri: uri, range: positions [ " 5️⃣ " ] ..< positions [ " 6️⃣ " ] ) ,
1200
+ children: [ ] ,
1201
+ tags: [ ]
1202
+ ) ,
1203
+ ] ,
1204
+ tags: [ ]
1205
+ )
1206
+ ]
1207
+ )
1208
+ }
1209
+
1152
1210
func testFullyQualifySwiftTestingTestAttribute( ) async throws {
1153
1211
let testClient = try await TestSourceKitLSPClient ( )
1154
1212
let uri = DocumentURI . for ( . swift)
You can’t perform that action at this time.
0 commit comments