1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01: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()))); 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())
} }