mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 13:51:50 +01:00
add websocket empty close status test
This commit is contained in:
parent
5528cf62f0
commit
dc9a24a189
@ -60,6 +60,16 @@ fn test_simple() {
|
|||||||
assert_eq!(item, Some(ws::Message::Close(ws::CloseCode::Normal)));
|
assert_eq!(item, Some(ws::Message::Close(ws::CloseCode::Normal)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_empty_close_code() {
|
||||||
|
let mut srv = test::TestServer::new(|app| app.handler(|req| ws::start(req, Ws)));
|
||||||
|
let (reader, mut writer) = srv.ws().unwrap();
|
||||||
|
|
||||||
|
writer.close(ws::CloseCode::Empty, "");
|
||||||
|
let (item, _) = srv.execute(reader.into_future()).unwrap();
|
||||||
|
assert_eq!(item, Some(ws::Message::Close(ws::CloseCode::Status)));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_large_text() {
|
fn test_large_text() {
|
||||||
let data = rand::thread_rng()
|
let data = rand::thread_rng()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user