@@ -585,62 +585,15 @@ final class DocumentTestDiscoveryTests: XCTestCase {
585
585
)
586
586
}
587
587
588
- func testSwiftTestingTestWithStringTags ( ) async throws {
588
+ func testSwiftTestingTestWithTags ( ) async throws {
589
589
let testClient = try await TestSourceKitLSPClient ( )
590
590
let uri = DocumentURI . for ( . swift)
591
591
592
592
let positions = testClient. openDocument (
593
593
"""
594
594
import Testing
595
595
596
- 1️⃣@Suite(.tags( " Suites " ))
597
- struct MyTests {
598
- 2️⃣@Test(.tags( " one " , " two " ))
599
- func oneIsTwo() {
600
- #expect(1 == 2)
601
- }3️⃣
602
- }4️⃣
603
- """ ,
604
- uri: uri
605
- )
606
-
607
- let tests = try await testClient. send ( DocumentTestsRequest ( textDocument: TextDocumentIdentifier ( uri) ) )
608
- XCTAssertEqual (
609
- tests,
610
- [
611
- TestItem (
612
- id: " MyTests " ,
613
- label: " MyTests " ,
614
- disabled: false ,
615
- style: TestStyle . swiftTesting,
616
- location: Location ( uri: uri, range: positions [ " 1️⃣ " ] ..< positions [ " 4️⃣ " ] ) ,
617
- children: [
618
- TestItem (
619
- id: " MyTests/oneIsTwo() " ,
620
- label: " oneIsTwo() " ,
621
- disabled: false ,
622
- style: TestStyle . swiftTesting,
623
- location: Location ( uri: uri, range: positions [ " 2️⃣ " ] ..< positions [ " 3️⃣ " ] ) ,
624
- children: [ ] ,
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 " ))
596
+ 1️⃣@Suite(.tags(.green))
644
597
struct MyTests {
645
598
2️⃣@Test(.tags(.red, .blue))
646
599
func oneIsTwo() {
@@ -669,10 +622,10 @@ final class DocumentTestDiscoveryTests: XCTestCase {
669
622
style: TestStyle . swiftTesting,
670
623
location: Location ( uri: uri, range: positions [ " 2️⃣ " ] ..< positions [ " 3️⃣ " ] ) ,
671
624
children: [ ] ,
672
- tags: [ TestTag ( id: " red " ) , TestTag ( id: " blue " ) ]
625
+ tags: [ TestTag ( id: " . red" ) , TestTag ( id: " . blue" ) ]
673
626
)
674
627
] ,
675
- tags: [ TestTag ( id: " Suites " ) ]
628
+ tags: [ TestTag ( id: " .green " ) ]
676
629
)
677
630
]
678
631
)
@@ -687,6 +640,7 @@ final class DocumentTestDiscoveryTests: XCTestCase {
687
640
import Testing
688
641
689
642
extension Tag {
643
+ @Tag static var suite: Self
690
644
@Tag static var foo: Self
691
645
@Tag static var bar: Self
692
646
@Tag static var baz: Self
@@ -696,7 +650,7 @@ final class DocumentTestDiscoveryTests: XCTestCase {
696
650
}
697
651
}
698
652
699
- 1️⃣@Suite(.tags( " Suites " ))
653
+ 1️⃣@Suite(.tags(.suite ))
700
654
struct MyTests {
701
655
2️⃣@Test(.tags(.foo, Nested.foo, Testing.Tag.bar, Tag.baz))
702
656
func oneIsTwo() {
@@ -725,10 +679,15 @@ final class DocumentTestDiscoveryTests: XCTestCase {
725
679
style: TestStyle . swiftTesting,
726
680
location: Location ( uri: uri, range: positions [ " 2️⃣ " ] ..< positions [ " 3️⃣ " ] ) ,
727
681
children: [ ] ,
728
- tags: [ TestTag ( id: " foo " ) , TestTag ( id: " Nested.foo " ) , TestTag ( id: " bar " ) , TestTag ( id: " baz " ) ]
682
+ tags: [
683
+ TestTag ( id: " .foo " ) ,
684
+ TestTag ( id: " Nested.foo " ) ,
685
+ TestTag ( id: " .bar " ) ,
686
+ TestTag ( id: " .baz " )
687
+ ]
729
688
)
730
689
] ,
731
- tags: [ TestTag ( id: " Suites " ) ]
690
+ tags: [ TestTag ( id: " .suite " ) ]
732
691
)
733
692
]
734
693
)
0 commit comments