diff --git a/Sources/Testing/Testing.docc/Traits.md b/Sources/Testing/Testing.docc/Traits.md index 46fa82b4d..d14eda999 100644 --- a/Sources/Testing/Testing.docc/Traits.md +++ b/Sources/Testing/Testing.docc/Traits.md @@ -48,12 +48,10 @@ types that customize the behavior of your tests. - ``Trait/bug(_:id:_:)-10yf5`` - ``Trait/bug(_:id:_:)-3vtpl`` - ### Creating custom traits @@ -67,8 +65,8 @@ types that customize the behavior of your tests. - ``Bug`` - ``Comment`` - ``ConditionTrait`` +- ``IssueHandlingTrait`` - ``ParallelizationTrait`` - ``Tag`` - ``Tag/List`` - ``TimeLimitTrait`` - diff --git a/Sources/Testing/Traits/IssueHandlingTrait.swift b/Sources/Testing/Traits/IssueHandlingTrait.swift index e8142ff5a..168a32e7b 100644 --- a/Sources/Testing/Traits/IssueHandlingTrait.swift +++ b/Sources/Testing/Traits/IssueHandlingTrait.swift @@ -24,7 +24,10 @@ /// /// - ``Trait/compactMapIssues(_:)`` /// - ``Trait/filterIssues(_:)`` -@_spi(Experimental) +/// +/// @Metadata { +/// @Available(Swift, introduced: 99.9) // TODO: Replace with final version +/// } public struct IssueHandlingTrait: TestTrait, SuiteTrait { /// A function which handles an issue and returns an optional replacement. /// @@ -49,6 +52,10 @@ public struct IssueHandlingTrait: TestTrait, SuiteTrait { /// /// - Returns: An issue to replace `issue`, or else `nil` if the issue should /// not be recorded. + /// + /// @Metadata { + /// @Available(Swift, introduced: 99.9) // TODO: Replace with final version + /// } public func handleIssue(_ issue: Issue) -> Issue? { _handler(issue) } @@ -58,6 +65,9 @@ public struct IssueHandlingTrait: TestTrait, SuiteTrait { } } +/// @Metadata { +/// @Available(Swift, introduced: 99.9) // TODO: Replace with final version +/// } extension IssueHandlingTrait: TestScoping { public func scopeProvider(for test: Test, testCase: Test.Case?) -> Self? { // Provide scope for tests at both the suite and test case levels, but not @@ -126,7 +136,6 @@ extension IssueHandlingTrait: TestScoping { } } -@_spi(Experimental) extension Trait where Self == IssueHandlingTrait { /// Constructs an trait that transforms issues recorded by a test. /// @@ -158,6 +167,10 @@ extension Trait where Self == IssueHandlingTrait { /// - Note: `transform` will never be passed an issue for which the value of /// ``Issue/kind`` is ``Issue/Kind/system``, and may not return such an /// issue. + /// + /// @Metadata { + /// @Available(Swift, introduced: 99.9) // TODO: Replace with final version + /// } public static func compactMapIssues(_ transform: @escaping @Sendable (Issue) -> Issue?) -> Self { Self(handler: transform) } @@ -192,6 +205,10 @@ extension Trait where Self == IssueHandlingTrait { /// /// - Note: `isIncluded` will never be passed an issue for which the value of /// ``Issue/kind`` is ``Issue/Kind/system``. + /// + /// @Metadata { + /// @Available(Swift, introduced: 99.9) // TODO: Replace with final version + /// } public static func filterIssues(_ isIncluded: @escaping @Sendable (Issue) -> Bool) -> Self { Self { issue in isIncluded(issue) ? issue : nil diff --git a/Tests/TestingTests/Traits/IssueHandlingTraitTests.swift b/Tests/TestingTests/Traits/IssueHandlingTraitTests.swift index eb1aa1233..70b35cdf4 100644 --- a/Tests/TestingTests/Traits/IssueHandlingTraitTests.swift +++ b/Tests/TestingTests/Traits/IssueHandlingTraitTests.swift @@ -8,7 +8,7 @@ // See https://swift.org/CONTRIBUTORS.txt for Swift project authors // -@testable @_spi(Experimental) @_spi(ForToolsIntegrationOnly) import Testing +@testable @_spi(ForToolsIntegrationOnly) import Testing @Suite("IssueHandlingTrait Tests") struct IssueHandlingTraitTests {