mirror of
https://github.com/actix/actix-web.git
synced 2024-12-29 19:40:34 +00:00
add websocket empty close status test
This commit is contained in:
parent
5528cf62f0
commit
dc9a24a189
1 changed files with 10 additions and 0 deletions
|
@ -60,6 +60,16 @@ fn test_simple() {
|
|||
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]
|
||||
fn test_large_text() {
|
||||
let data = rand::thread_rng()
|
||||
|
|
Loading…
Reference in a new issue