You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Testing/Testing.docc/Attachments.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ protocol to create your own attachable types.
20
20
### Attach data or strings
21
21
22
22
If your test produces encoded data that you want to save as an attachment, you
23
-
can call ``Attachment/record(_:named:sourceLocation:)``:
23
+
can call ``Attachment/record(_:named:sourceLocation:)``.
24
24
25
25
```swift
26
26
structSalesReport { ... }
@@ -56,7 +56,7 @@ you can extend it to add conformance to ``Attachable``. When you import the
56
56
[Foundation](https://developer.apple.com/documentation/foundation) module, the
57
57
testing library automatically provides a default implementation of
58
58
``Attachable`` to types that also conform to [`Encodable`](https://developer.apple.com/documentation/swift/encodable)
59
-
or [`NSSecureCoding`](https://developer.apple.com/documentation/foundation/nssecurecoding):
59
+
or [`NSSecureCoding`](https://developer.apple.com/documentation/foundation/nssecurecoding).
60
60
61
61
```swift
62
62
importTesting
@@ -88,7 +88,7 @@ You can attach instances of the following system-provided image types to a test:
88
88
| Windows |[`HBITMAP`](https://learn.microsoft.com/en-us/windows/win32/gdi/bitmaps), [`HICON`](https://learn.microsoft.com/en-us/windows/win32/menurc/icons), [`IWICBitmapSource`](https://learn.microsoft.com/en-us/windows/win32/api/wincodec/nn-wincodec-iwicbitmapsource) (including its subclasses declared by Windows Imaging Component) |
89
89
90
90
When you attach an image to a test, you can specify the image format to use in
91
-
addition to a preferred name:
91
+
addition to a preferred name.
92
92
93
93
```swift
94
94
structSalesReport { ... }
@@ -109,7 +109,7 @@ If you have a value that needs a custom encoded representation when you save it
109
109
as an attachment, implement ``Attachable/withUnsafeBytes(for:_:)``. The
110
110
implementation of this function calls its `body` argument and passes the encoded
111
111
representation of `self` or, if a failure occurs, throws an error representing
112
-
that failure:
112
+
that failure.
113
113
114
114
```swift
115
115
structSalesReport { ... }
@@ -137,7 +137,7 @@ the testing library calls this function as soon as you record the attachment.
137
137
If you can reliably estimate in advance how large the encoded representation
138
138
will be, implement ``Attachable/estimatedAttachmentByteCount``. The testing
139
139
library uses the value of this property as a hint to optimize memory and disk
0 commit comments