Skip to content

Commit

Permalink
send
Browse files Browse the repository at this point in the history
  • Loading branch information
swhitty committed Nov 23, 2024
1 parent 5653d61 commit a2f79a4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions FlyingSocks/Tests/AsyncSocketTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,22 @@ struct AsyncSocketTests {
try await received?.payloadString == "Fish 🐡"
)
}

@Test
func messageSequence_sendsMessage_receivesMessage() async throws {
let (socket, port) = try await AsyncSocket.makeLoopbackDatagram()
var messages = socket.messages

async let received = messages.next()

let client = try await AsyncSocket.makeLoopbackDatagram().0
let message = AsyncSocket.Message(peerAddress: .loopback(port: port), bytes: [0x01, 0x02])
try await client.send(message: message)

#expect(
try await received?.bytes == [0x01, 0x02]
)
}
}

extension AsyncSocket {
Expand Down

0 comments on commit a2f79a4

Please sign in to comment.