1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-17 13:46:36 +00:00

Check WS stream completed after close.

This commit is contained in:
Yury Yarashevich 2023-08-01 16:39:16 +02:00
parent d3911ec285
commit a5f8534573

View file

@ -52,6 +52,10 @@ async fn common_test_code(mut srv: actix_test::TestServer, frame_size: usize) {
.unwrap(); .unwrap();
let item = framed.next().await.unwrap().unwrap(); let item = framed.next().await.unwrap().unwrap();
assert_eq!(item, ws::Frame::Close(Some(ws::CloseCode::Normal.into()))); assert_eq!(item, ws::Frame::Close(Some(ws::CloseCode::Normal.into())));
let nothing = actix_rt::time::timeout(std::time::Duration::from_secs(1), framed.next()).await;
assert_eq!(true, nothing.is_ok());
assert_eq!(true, nothing.unwrap().is_none());
} }
#[actix_rt::test] #[actix_rt::test]