Skip to content

Commit da4a7ff

Browse files
committed
Improve test
1 parent bca5dd9 commit da4a7ff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Tests/GRPCInProcessTransportTests/InProcessTransportTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ struct InProcessTransportTests {
8383
try $0.message
8484
}
8585

86-
let match = peerInfo.wholeMatch(of: /in-process:\d+/)
87-
#expect(match != nil)
86+
let maybeMatch = peerInfo.wholeMatch(of: /local: in-process:(\d+), remote: in-process:(\d+)/)
87+
let match = try #require(maybeMatch)
88+
#expect(match.1 == match.2)
8889
}
8990
}
9091
}
@@ -123,7 +124,8 @@ private struct TestService: RegistrableRPCService {
123124
request: ServerRequest<Void>,
124125
context: ServerContext
125126
) async throws -> ServerResponse<String> {
126-
return ServerResponse(message: context.remotePeer)
127+
let peerInfo = "local: \(context.localPeer), remote: \(context.remotePeer)"
128+
return ServerResponse(message: peerInfo)
127129
}
128130

129131
func registerMethods(with router: inout RPCRouter) {

0 commit comments

Comments
 (0)