@@ -585,7 +585,7 @@ final class DocumentTestDiscoveryTests: XCTestCase {
585
585
)
586
586
}
587
587
588
- func testSwiftTestingTestWithTags ( ) async throws {
588
+ func testSwiftTestingTestWithStringTags ( ) async throws {
589
589
let testClient = try await TestSourceKitLSPClient ( )
590
590
let uri = DocumentURI . for ( . swift)
591
591
@@ -595,7 +595,7 @@ final class DocumentTestDiscoveryTests: XCTestCase {
595
595
596
596
1️⃣@Suite(.tags( " Suites " ))
597
597
struct MyTests {
598
- 2️⃣@Test(.tags( " one " , " two " , .red, .blue ))
598
+ 2️⃣@Test(.tags( " one " , " two " ))
599
599
func oneIsTwo() {
600
600
#expect(1 == 2)
601
601
}3️⃣
@@ -622,7 +622,54 @@ final class DocumentTestDiscoveryTests: XCTestCase {
622
622
style: TestStyle . swiftTesting,
623
623
location: Location ( uri: uri, range: positions [ " 2️⃣ " ] ..< positions [ " 3️⃣ " ] ) ,
624
624
children: [ ] ,
625
- tags: [ TestTag ( id: " one " ) , TestTag ( id: " two " ) , TestTag ( id: " red " ) , TestTag ( id: " blue " ) ]
625
+ tags: [ TestTag ( id: " one " ) , TestTag ( id: " two " ) ]
626
+ )
627
+ ] ,
628
+ tags: [ TestTag ( id: " Suites " ) ]
629
+ )
630
+ ]
631
+ )
632
+ }
633
+
634
+
635
+ func testSwiftTestingTestWithMemberTags( ) async throws {
636
+ let testClient = try await TestSourceKitLSPClient ( )
637
+ let uri = DocumentURI . for ( . swift)
638
+
639
+ let positions = testClient. openDocument (
640
+ """
641
+ import Testing
642
+
643
+ 1️⃣@Suite(.tags( " Suites " ))
644
+ struct MyTests {
645
+ 2️⃣@Test(.tags(.red, .blue))
646
+ func oneIsTwo() {
647
+ #expect(1 == 2)
648
+ }3️⃣
649
+ }4️⃣
650
+ """ ,
651
+ uri: uri
652
+ )
653
+
654
+ let tests = try await testClient. send ( DocumentTestsRequest ( textDocument: TextDocumentIdentifier ( uri) ) )
655
+ XCTAssertEqual (
656
+ tests,
657
+ [
658
+ TestItem (
659
+ id: " MyTests " ,
660
+ label: " MyTests " ,
661
+ disabled: false ,
662
+ style: TestStyle . swiftTesting,
663
+ location: Location ( uri: uri, range: positions [ " 1️⃣ " ] ..< positions [ " 4️⃣ " ] ) ,
664
+ children: [
665
+ TestItem (
666
+ id: " MyTests/oneIsTwo() " ,
667
+ label: " oneIsTwo() " ,
668
+ disabled: false ,
669
+ style: TestStyle . swiftTesting,
670
+ location: Location ( uri: uri, range: positions [ " 2️⃣ " ] ..< positions [ " 3️⃣ " ] ) ,
671
+ children: [ ] ,
672
+ tags: [ TestTag ( id: " red " ) , TestTag ( id: " blue " ) ]
626
673
)
627
674
] ,
628
675
tags: [ TestTag ( id: " Suites " ) ]
0 commit comments