Skip to content

Commit

Permalink
update coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MacOMNI committed Nov 26, 2024
1 parent 8327fc0 commit 2372267
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions Networking/Tests/NetworkingTests/PKCS12Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct PKCS12Tests {

let registration = try QuicRegistration()

let serverHandler = MockQuicEventHandler()
let clientHandler = MockQuicEventHandler()
let serverHandler = MockPeerEventTests.MockPeerEventHandler()
let clientHandler = MockPeerEventTests.MockPeerEventHandler()

// create listener

Expand Down Expand Up @@ -71,26 +71,20 @@ struct PKCS12Tests {

try? await Task.sleep(for: .milliseconds(50))

let clientData = clientHandler.events.value.compactMap {
switch $0 {
case let .shouldOpen(_, certificate):
certificate as Data?
default:
nil
let clientConn = clientHandler.events.value.compactMap {
if case let .connected(connection: connection) = $0 {
return connection
}
}

#expect(clientData.first!.count > 0)
return nil
}.first!
#expect(clientConn != nil)

let serverData = serverHandler.events.value.compactMap {
switch $0 {
case let .shouldOpen(_, certificate):
certificate as Data?
default:
nil
let serverConn = serverHandler.events.value.compactMap {
if case let .connected(connection: connection) = $0 {
return connection
}
}

#expect(serverData.first!.count > 0)
return nil
}.first!
#expect(serverConn != nil)
}
}

0 comments on commit 2372267

Please sign in to comment.