1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-19 14:49:01 +00:00

add close ws test

This commit is contained in:
Nikolay Kim 2018-01-30 16:04:04 -08:00
parent b698e3546b
commit 5a5497b745

View file

@ -44,6 +44,10 @@ fn test_simple() {
assert_eq!(item, Some(ws::Message::Binary(Bytes::from_static(b"text").into())));
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())));
writer.close(ws::CloseCode::Normal, "");
let (item, _) = srv.execute(reader.into_future()).unwrap();
assert!(item.is_none())
}