Skip to content

Commit 6d4fd83

Browse files
committed
Update migration doc advice for XCTAssertThrowsError
1 parent 1a6938e commit 6d4fd83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Testing/Testing.docc/MigratingFromXCTest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ their equivalents in the testing library:
326326
| `XCTAssertLessThanOrEqual(x, y)` | `#expect(x <= y)` |
327327
| `XCTAssertLessThan(x, y)` | `#expect(x < y)` |
328328
| `XCTAssertThrowsError(try f())` | `#expect(throws: (any Error).self) { try f() }` |
329-
| `XCTAssertThrowsError(try f()) { error in … }` | `#expect { try f() } throws: { error in return … }` |
329+
| `XCTAssertThrowsError(try f()) { error in … }` | `let error = #expect(throws: (any Error).self) { try f() }` |
330330
| `XCTAssertNoThrow(try f())` | `#expect(throws: Never.self) { try f() }` |
331331
| `try XCTUnwrap(x)` | `try #require(x)` |
332332
| `XCTFail("…")` | `Issue.record("…")` |

0 commit comments

Comments
 (0)