Skip to content

Commit bb05522

Browse files
committed
Test sink and stream
1 parent 20466e8 commit bb05522

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ws.rs

+15
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,21 @@ async fn binary() {
8181
assert_eq!(msg.as_bytes(), &b"bonk"[..]);
8282
}
8383

84+
#[tokio::test]
85+
async fn wsclient_sink_and_stream() {
86+
let _ = pretty_env_logger::try_init();
87+
88+
let mut client = warp::test::ws()
89+
.handshake(ws_echo())
90+
.await
91+
.expect("handshake");
92+
93+
let message = warp::ws::Message::text("hello");
94+
SinkExt::send(&mut client, message.clone()).await.unwrap();
95+
let received_message = client.next().await.unwrap().unwrap();
96+
assert_eq!(message, received_message);
97+
}
98+
8499
#[tokio::test]
85100
async fn close_frame() {
86101
let _ = pretty_env_logger::try_init();

0 commit comments

Comments
 (0)