From 5a5497b7450c2753ea5285837b92fc36dd3bffff Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 30 Jan 2018 16:04:04 -0800 Subject: [PATCH] add close ws test --- tests/test_ws.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_ws.rs b/tests/test_ws.rs index 83a7caf03..29db0b9ed 100644 --- a/tests/test_ws.rs +++ b/tests/test_ws.rs @@ -44,6 +44,10 @@ fn test_simple() { assert_eq!(item, Some(ws::Message::Binary(Bytes::from_static(b"text").into()))); 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()))); + + writer.close(ws::CloseCode::Normal, ""); + let (item, _) = srv.execute(reader.into_future()).unwrap(); + assert!(item.is_none()) }