Skip to content

Commit

Permalink
Test sink and stream
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Oct 10, 2021
1 parent 924d881 commit f2b934f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ async fn binary() {
assert_eq!(msg.as_bytes(), &b"bonk"[..]);
}

#[tokio::test]
async fn wsclient_sink_and_stream() {
let _ = pretty_env_logger::try_init();

let mut client = warp::test::ws()
.handshake(ws_echo())
.await
.expect("handshake");

let message = warp::ws::Message::text("hello");
SinkExt::send(&mut client, message.clone()).await.unwrap();
let received_message = client.next().await.unwrap().unwrap();
assert_eq!(message, received_message);
}

#[tokio::test]
async fn close_frame() {
let _ = pretty_env_logger::try_init();
Expand Down

0 comments on commit f2b934f

Please sign in to comment.