File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -188,15 +188,25 @@ final class MachPortTests: XCTestCase {
188188 let recv = Mach . Port < Mach . ReceiveRight > ( )
189189 let send = recv. makeSendRight ( )
190190 _ = consume recv // and turn `send` into a dead name
191- XCTAssertThrowsError ( try send. copySendRight ( ) , " Copying a dead name should throw " ) { error in
192- XCTAssertEqual ( error, Mach . PortRightError. deadName)
191+ XCTAssertThrowsError (
192+ _ = try send. copySendRight ( ) ,
193+ " Copying a dead name should throw "
194+ ) { error in
195+ XCTAssertEqual (
196+ error as! Mach . PortRightError , Mach . PortRightError. deadName
197+ )
193198 }
194199 }
195200
196201 func testCopyDeadName2( ) throws {
197202 let send = Mach . Port< Mach . SendRight> ( name: 0xffffffff )
198- XCTAssertThrowsError ( try send. copySendRight ( ) , " Copying a dead name should throw " ) { error in
199- XCTAssertEqual ( error, Mach . PortRightError. deadName)
203+ XCTAssertThrowsError (
204+ _ = try send. copySendRight ( ) ,
205+ " Copying a dead name should throw "
206+ ) { error in
207+ XCTAssertEqual (
208+ error as! Mach . PortRightError , Mach . PortRightError. deadName
209+ )
200210 }
201211 }
202212
You can’t perform that action at this time.
0 commit comments