mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
add close ws test
This commit is contained in:
parent
b698e3546b
commit
5a5497b745
@ -44,6 +44,10 @@ fn test_simple() {
|
|||||||
assert_eq!(item, Some(ws::Message::Binary(Bytes::from_static(b"text").into())));
|
assert_eq!(item, Some(ws::Message::Binary(Bytes::from_static(b"text").into())));
|
||||||
|
|
||||||
writer.ping("ping");
|
writer.ping("ping");
|
||||||
let (item, _) = srv.execute(reader.into_future()).unwrap();
|
let (item, reader) = srv.execute(reader.into_future()).unwrap();
|
||||||
assert_eq!(item, Some(ws::Message::Pong("ping".to_owned())));
|
assert_eq!(item, Some(ws::Message::Pong("ping".to_owned())));
|
||||||
|
|
||||||
|
writer.close(ws::CloseCode::Normal, "");
|
||||||
|
let (item, _) = srv.execute(reader.into_future()).unwrap();
|
||||||
|
assert!(item.is_none())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user