diff --git a/Tests/SystemTests/MachPortTests.swift b/Tests/SystemTests/MachPortTests.swift index 8a6ade6..07b7410 100644 --- a/Tests/SystemTests/MachPortTests.swift +++ b/Tests/SystemTests/MachPortTests.swift @@ -188,15 +188,25 @@ final class MachPortTests: XCTestCase { let recv = Mach.Port() let send = recv.makeSendRight() _ = consume recv // and turn `send` into a dead name - XCTAssertThrowsError(try send.copySendRight(), "Copying a dead name should throw") { error in - XCTAssertEqual(error, Mach.PortRightError.deadName) + XCTAssertThrowsError( + _ = try send.copySendRight(), + "Copying a dead name should throw" + ) { error in + XCTAssertEqual( + error as! Mach.PortRightError, Mach.PortRightError.deadName + ) } } func testCopyDeadName2() throws { let send = Mach.Port(name: 0xffffffff) - XCTAssertThrowsError(try send.copySendRight(), "Copying a dead name should throw") { error in - XCTAssertEqual(error, Mach.PortRightError.deadName) + XCTAssertThrowsError( + _ = try send.copySendRight(), + "Copying a dead name should throw" + ) { error in + XCTAssertEqual( + error as! Mach.PortRightError, Mach.PortRightError.deadName + ) } }