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
Provide prose documentation for attachments. (#1413)
This PR adds prose documentation explaining how to create attachments
and add them to tests.
Resolves#1143.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
---------
Co-authored-by: jgmcnutt <jgmcnutt@me.com>
/// | 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) |
56
-
///
57
48
/// You do not generally need to add your own conformances to this protocol. If
58
49
/// you have an image in another format that needs to be attached to a test,
59
50
/// first convert it to an instance of one of the types above.
Copy file name to clipboardExpand all lines: Sources/Testing/Attachments/Images/AttachableImageFormat.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,8 @@
17
17
/// instance of this type, the testing library infers which format to use based
18
18
/// on the attachment's preferred name.
19
19
///
20
-
/// The PNG and JPEG image formats are always supported. The set of additional
21
-
/// supported image formats is platform-specific:
20
+
/// The testing library always supports the PNG and JPEG image formats. The set
21
+
/// of additional supported image formats is platform-specific:
22
22
///
23
23
/// - On Apple platforms, you can use [`CGImageDestinationCopyTypeIdentifiers()`](https://developer.apple.com/documentation/imageio/cgimagedestinationcopytypeidentifiers())
24
24
/// from the [Image I/O framework](https://developer.apple.com/documentation/imageio)
/// | 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) |
40
-
///
41
32
/// The testing library uses the image format specified by `imageFormat`. Pass
42
33
/// `nil` to let the testing library decide which image format to use. If you
43
34
/// pass `nil`, then the image format that the testing library uses depends on
@@ -70,22 +61,14 @@ extension Attachment {
70
61
/// - sourceLocation: The source location of the call to this function.
71
62
///
72
63
/// This function creates a new instance of ``Attachment`` wrapping `image`
73
-
/// and immediately attaches it to the current test. You can attach instances
74
-
/// of the following system-provided image types to a test:
/// | 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) |
81
-
///
82
-
/// The testing library uses the image format specified by `imageFormat`. Pass
83
-
/// `nil` to let the testing library decide which image format to use. If you
84
-
/// pass `nil`, then the image format that the testing library uses depends on
85
-
/// the path extension you specify in `preferredName`, if any. If you do not
86
-
/// specify a path extension, or if the path extension you specify doesn't
87
-
/// correspond to an image format the operating system knows how to write, the
88
-
/// testing library selects an appropriate image format for you.
64
+
/// and immediately attaches it to the current test. The testing library uses
65
+
/// the image format that `imageFormat` specifies. Pass `nil` to let the testing
66
+
/// library select which image format to use. If you pass `nil`, the
67
+
/// image format that the testing library uses depends on the path extension
68
+
/// you specify in `preferredName`, if any. If you don't specify a path
69
+
/// extension, or if the path extension you specify doesn't correspond to an
70
+
/// image format the operating system knows how to write, the testing library
/// | 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) |
21
12
#if SWT_NO_IMAGE_ATTACHMENTS
22
13
@_unavailableInEmbedded
23
14
@available(*, unavailable, message:"Image attachments are not available on this platform.")
| 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
+
90
+
When you attach an image to a test, you can specify the image format to use in
0 commit comments