mirror of
https://github.com/actix/actix-web.git
synced 2024-12-24 00:50:36 +00:00
add close ws test
This commit is contained in:
parent
b698e3546b
commit
5a5497b745
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue