Skip to content

Commit 02f4c7b

Browse files
authored
Merge pull request #2781 from younata/younata/testing-attachments-accepted
Mark ST-0009: Attachments as accepted
2 parents 964afd9 + cd7fec5 commit 02f4c7b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

proposals/testing/0009-attachments.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Proposal: [ST-0009](0009-attachments.md)
44
* Authors: [Jonathan Grynspan](https://github.com/grynspan)
55
* Review Manager: [Rachel Brindle](https://github.com/younata)
6-
* Status: **Active Review (March 21 - April 8, 2025)**
6+
* Status: **Accepted**
77
* Bug: [swiftlang/swift-testing#714](https://github.com/swiftlang/swift-testing/issues/714)
88
* Implementation: [swiftlang/swift-testing#973](https://github.com/swiftlang/swift-testing/pull/973)
9-
* Review: ([review](https://forums.swift.org/t/st-0009-attachments/78698)), ([pitch](https://forums.swift.org/t/pitch-attachments/78072))
9+
* Review: ([acceptance](https://forums.swift.org/t/accepted-with-modifications-st-0009-attachments/79193)), ([review](https://forums.swift.org/t/st-0009-attachments/78698)), ([pitch](https://forums.swift.org/t/pitch-attachments/78072))
1010

1111
## Introduction
1212

@@ -170,8 +170,8 @@ conform:
170170
/// A type should conform to this protocol if it can be represented as a
171171
/// sequence of bytes that would be diagnostically useful if a test fails. If a
172172
/// type cannot conform directly to this protocol (such as a non-final class or
173-
/// a type declared in a third-party module), you can create a container type
174-
/// that conforms to ``AttachableContainer`` to act as a proxy.
173+
/// a type declared in a third-party module), you can create a wrapper type
174+
/// that conforms to ``AttachableWrapper`` to act as a proxy.
175175
public protocol Attachable: ~Copyable {
176176
/// An estimate of the number of bytes of memory needed to store this value as
177177
/// an attachment.
@@ -242,12 +242,12 @@ conformances, Foundation must be imported because `JSONEncoder` and
242242

243243
Some types cannot conform directly to `Attachable` because they require
244244
additional information to encode correctly, or because they are not directly
245-
`Sendable` or `Copyable`. A second protocol, `AttachableContainer`, is provided
245+
`Sendable` or `Copyable`. A second protocol, `AttachableWrapper`, is provided
246246
that refines `Attachable`:
247247

248248
```swift
249249
/// A protocol describing a type that can be attached to a test report or
250-
/// written to disk when a test is run and which contains another value that it
250+
/// written to disk when a test is run and which wraps another value that it
251251
/// stands in for.
252252
///
253253
/// To attach an attachable value to a test, pass it to ``Attachment/record(_:named:sourceLocation:)``.
@@ -259,21 +259,21 @@ that refines `Attachable`:
259259
/// A type can conform to this protocol if it represents another type that
260260
/// cannot directly conform to ``Attachable``, such as a non-final class or a
261261
/// type declared in a third-party module.
262-
public protocol AttachableContainer<AttachableValue>: Attachable, ~Copyable {
262+
public protocol AttachableWrapper<AttachableValue>: Attachable, ~Copyable {
263263
/// The type of the attachable value represented by this type.
264264
associatedtype AttachableValue
265265

266266
/// The attachable value represented by this instance.
267267
var attachableValue: AttachableValue { get }
268268
}
269269

270-
extension Attachment where AttachableValue: AttachableContainer & ~Copyable {
270+
extension Attachment where AttachableValue: AttachableWrapper & ~Copyable {
271271
/// The value of this attachment.
272272
///
273-
/// When the attachable value's type conforms to ``AttachableContainer``, the
274-
/// value of this property equals the container's underlying attachable value.
273+
/// When the attachable value's type conforms to ``AttachableWrapper``, the
274+
/// value of this property equals the wrappers's underlying attachable value.
275275
/// To access the attachable value as an instance of `T` (where `T` conforms
276-
/// to ``AttachableContainer``), specify the type explicitly:
276+
/// to ``AttachableWrapper``), specify the type explicitly:
277277
///
278278
/// ```swift
279279
/// let attachableValue = attachment.attachableValue as T
@@ -286,7 +286,7 @@ The cross-import overlay with Foundation also provides the following convenience
286286
interface for attaching the contents of a file or directory on disk:
287287

288288
```swift
289-
extension Attachment where AttachableValue == _AttachableURLContainer {
289+
extension Attachment where AttachableValue == _AttachableURLWrapper {
290290
/// Initialize an instance of this type with the contents of the given URL.
291291
///
292292
/// - Parameters:
@@ -307,7 +307,7 @@ extension Attachment where AttachableValue == _AttachableURLContainer {
307307
}
308308
```
309309

310-
`_AttachableURLContainer` is a type that conforms to `AttachableContainer` and
310+
`_AttachableURLWrapper` is a type that conforms to `AttachableWrapper` and
311311
encloses the URL and corresponding mapped data. As an implementation detail, it
312312
is omitted from this proposal for brevity.
313313

0 commit comments

Comments
 (0)