Skip to content

Commit ad40724

Browse files
committed
make test expression return Void
- It can’t return `Mach.Port<SendRight>`, because a noncopyable type cannot currently be a generic type argument.
1 parent faffb9a commit ad40724

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Tests/SystemTests/MachPortTests.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)