File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,19 @@ actor HTTPServerTests {
254
254
try await wsTask. send ( . string( " Hello " ) )
255
255
#expect( try await wsTask. receive ( ) == . string( " Hello " ) )
256
256
}
257
+
258
+ @Test
259
+ func server_ReturnsWebSocketFramesToURLSession_16BitMessage( ) async throws {
260
+ let server = HTTPServer . make ( address: . loopback( port: 0 ) )
261
+ await server. appendRoute ( " GET /socket " , to: . webSocket( EchoWSMessageHandler ( ) ) )
262
+ let port = try await startServerWithPort ( server)
263
+
264
+ let wsTask = URLSession . shared. webSocketTask ( with: URL ( string: " ws://localhost: \( port) /socket " ) !)
265
+ wsTask. resume ( )
266
+ let text = String ( String ( repeating: " A " , count: 126 ) )
267
+ try await wsTask. send ( . string( text) )
268
+ #expect( try await wsTask. receive ( ) == . string( text) )
269
+ }
257
270
#endif
258
271
259
272
@Test
You can’t perform that action at this time.
0 commit comments