Skip to content

Add Swift 6.3 Swift Testing APIs: issue severity, Test.cancel(), attachments#10

Open
nashysolutions-bot wants to merge 1 commit into
AvdLee:mainfrom
nashysolutions-bot:add-swift-6.3-testing-apis
Open

Add Swift 6.3 Swift Testing APIs: issue severity, Test.cancel(), attachments#10
nashysolutions-bot wants to merge 1 commit into
AvdLee:mainfrom
nashysolutions-bot:add-swift-6.3-testing-apis

Conversation

@nashysolutions-bot

Copy link
Copy Markdown
Contributor

Closes #9.

What

Swift 6.3 (March 2026) added three user-visible Swift Testing APIs that the skill didn't yet cover. This documents them in the existing reference files (no new files, no structural change).

API File Section
Issue.record(_:severity:) (.warning) expectations.md "Issue severity (Swift 6.3+)"
try Test.cancel(_:) fundamentals.md "Cancelling a test early (Swift 6.3+)"
Attachment.record(_:named:) xcode-workflows.md "Attachments (Swift 6.3+)"

Each addition follows the file's existing style: a short rule list (including a do/don't caveat) plus a minimal worked example.

Accuracy

Signatures verified against swiftlang/swift-testing main:

  • Issue.record(_:severity:).warning keeps the test passing.
  • Test.cancel(_ comment: Comment? = nil) -> Never (Test+Cancellation.swift) — the example passes a comment and relies on the Never return in a guard/else.
  • Attachment.record(_ attachableValue:named:) (Attachments/Attachment.swift) — image attachments are supported on Apple/Windows in 6.3.

Guidance choices

  • Test.cancel() is framed as a mid-test bail-out, with an explicit do/don't steering callers to .disabled / #require when the skip condition is known up front, and warning against using it to mask a real failure.
  • .warning severity is steered away from downgrading genuine correctness failures.

Source: https://www.swift.org/blog/swift-6.3-released/

…chments

Documents the three user-visible Swift Testing additions in Swift 6.3,
slotted into the existing reference files:

- expectations.md: Issue.record(_:severity:) with a .warning example
- fundamentals.md: try Test.cancel() for mid-test bail-out, with do/don't
  guidance on preferring .disabled/#require for up-front skip conditions
- xcode-workflows.md: Attachment.record(_:named:) for failure artifacts

Signatures verified against swiftlang/swift-testing main
(Test+Cancellation.swift, Attachments/Attachment.swift).

Closes AvdLee#9

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: code implementation verified for system consistency.

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: Implementation verified for system consistency and engineering integrity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Swift 6.3 Swift Testing APIs: Issue severity, Test.cancel(), and attachments

2 participants