Skip to content

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented Nov 7, 2025

When a string is attached to a test, we encode it as UTF-8 (as is tradition). This PR adjusts String's conformance to Attachable so that it uses the ".txt" extension (unless the user specifies something else). This improves usability in Xcode test reports by making these attachments double-clickable and QuickLookable (is that a word?)

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…tension.

When a string is attached to a test, we encode it as UTF-8 (as is tradition).
This PR adjusts `String`'s conformance to `Attachable` so that it uses the
`".txt"` extension (unless the user specifies something else). This improves
usability in Xcode test reports by making these attachments double-clickable
and QuickLookable (is that a word?)
@grynspan grynspan added this to the Swift 6.3.0 milestone Nov 7, 2025
@grynspan grynspan self-assigned this Nov 7, 2025
@grynspan grynspan added enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs command-line experience ⌨️ enhancements to the command line interface attachments/activities 🖇️ Work related to attachments and/or activities labels Nov 7, 2025
Copy link
Contributor

@jerryjrchen jerryjrchen left a comment

Choose a reason for hiding this comment

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

QuickLookable (is that a word?)

Maybe "Quickly Lookable" :)

}

/// @Metadata {
/// @Available(Swift, introduced: 6.2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The conformance was introduced in 6.2, so yes this is accurate. :)

@grynspan grynspan merged commit 564e4f2 into main Nov 7, 2025
27 checks passed
@grynspan grynspan deleted the jgrynspan/assume-txt-for-string-attachments branch November 7, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attachments/activities 🖇️ Work related to attachments and/or activities command-line experience ⌨️ enhancements to the command line interface enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants