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: _posts/2025-NN-NN-swift-6.2-released.md
+13-19Lines changed: 13 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,25 +133,19 @@ Swift 6.2 enables streaming transactional state changes of observable types usin
133
133
134
134
### Swift Testing
135
135
136
-
Swift Testing in Swift 6.2 supports [custom attachments](https://developer.apple.com/documentation/testing/attachments), letting you include additional context in your test results:
137
-
138
-
```swift
139
-
@Test
140
-
funcvalidateProposalID() asyncthrows {
141
-
let (data, _) =tryawait URLSession.shared.data(from: evolutionJSONMetadataURL)
let metadata =try jsonDecoder.decode(EvolutionMetadata.self, from: data)
146
-
for proposal in metadata.proposals {
147
-
#expect(proposal.id.starts(with: "SE"))
148
-
}
149
-
}
150
-
```
151
-
152
-
You can attach strings, images, logs, and other artifacts directly to a test outcome. These attachments are included in test reports or written to disk, making it easier to diagnose failures with concrete evidence—whether that’s a screenshot of a UI state, a JSON payload, or a trace of steps leading up to the issue.
153
-
154
-
Swift Testing also supports [exit testing](https://developer.apple.com/documentation/testing/exit-testing), which lets you verify that code terminates under specific conditions, such as a failed precondition. Swift Testing will run your exit tests in a new process and validate that the exit behavior is what you expect. This makes it possible to exercise critical failure paths like you would in any other test.
136
+
Swift Testing in Swift 6.2 adds new APIs for enhanced expressivity in your tests and test results:
137
+
138
+
*[**Exit testing**](https://developer.apple.com/documentation/testing/exit-testing) lets you verify that code terminates under specific conditions, such as a failed precondition. Your exit tests run in a new process and validate that the exit behavior is what you expect, making it possible to exercise critical failure paths like you would in any other test.
139
+
*[**Attachments**](https://developer.apple.com/documentation/testing/attachments) let you include additional context in test results, including strings, images, logs, and other artifacts, surfaced in test reports or written to disk. This makes it easier to diagnose failures with concrete evidence—whether that’s a screenshot of a UI state, a JSON payload, or a trace of steps leading up to the issue.
140
+
*[**Raw identifier display names**](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0451-escaped-identifiers.md) let you customize the names of test functions and suite types with less code:
0 commit comments