-
Notifications
You must be signed in to change notification settings - Fork 120
Avoid passive voice and clarify macro in exit test docs. #1243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,11 +107,12 @@ func `Customer won't eat food unless it's nutritious`(_ food: Food) async { | |
} | ||
``` | ||
|
||
- Note: If you use this macro with a Swift compiler version lower than 6.3, it | ||
doesn't support capturing state. | ||
- Note: If you use the ``expect(processExitsWith:observing:_:sourceLocation:performing:)`` | ||
macro with a Swift compiler version lower than 6.3, it doesn't support | ||
capturing state. | ||
|
||
If a captured value is an argument to the current function or is `self`, its | ||
type is inferred at compile time. Otherwise, explicitly specify the type of the | ||
If a captured value is an argument to the current function or is `self`, the | ||
compiler infers the value's type. Otherwise, explicitly specify the type of the | ||
value using the `as` operator: | ||
|
||
```swift | ||
|
@@ -126,10 +127,10 @@ value using the `as` operator: | |
``` | ||
|
||
Every value you capture in an exit test must conform to [`Sendable`](https://developer.apple.com/documentation/swift/sendable) | ||
and [`Codable`](https://developer.apple.com/documentation/swift/codable). Each | ||
value is encoded by the parent process using [`encode(to:)`](https://developer.apple.com/documentation/swift/encodable/encode(to:)) | ||
and is decoded by the child process [`init(from:)`](https://developer.apple.com/documentation/swift/decodable/init(from:)) | ||
before being passed to the exit test body. | ||
and [`Codable`](https://developer.apple.com/documentation/swift/codable). The | ||
testing library encodes each value using [`encode(to:)`](https://developer.apple.com/documentation/swift/encodable/encode(to:)) | ||
in the parent process, and decodes it using [`init(from:)`](https://developer.apple.com/documentation/swift/decodable/init(from:)) | ||
in the child process, before passing it to the exit test body. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new commas are incorrect, at least the way I was taught (circa 1854.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The words "and", and "before", are acting as coordinating conjunctions between independent clauses in this sentence. While you can always find a grammar "rule" that says you should use a comma in the same place that another "rule" says you shouldn't use one, I think the commas separate the independent clauses here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could split the difference and make this a list of steps instead? |
||
|
||
If a captured value's type does not conform to both `Sendable` and `Codable`, or | ||
if the value is not explicitly specified in the exit test body's capture list, | ||
|
Uh oh!
There was an error while loading. Please reload this page.