File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,9 +98,7 @@ async fn test_ping_pong() {
9898 let mut ws = accept_async ( stream) . await . unwrap ( ) ;
9999
100100 let msg = ws. read ( ) . await . unwrap ( ) ;
101- if let Message :: Ping ( data) = msg {
102- ws. send ( Message :: Pong ( data) ) . await . unwrap ( ) ;
103- }
101+ assert ! ( matches!( msg, Message :: Ping ( _) ) ) ;
104102 } )
105103 . detach ( ) ;
106104
@@ -141,6 +139,8 @@ async fn test_close_handshake() {
141139 let ( mut ws, _) = client_async ( & format ! ( "ws://{}" , addr) , tcp) . await . unwrap ( ) ;
142140
143141 ws. close ( None ) . await . unwrap ( ) ;
142+ let msg = ws. read ( ) . await . unwrap ( ) ;
143+ assert ! ( msg. is_close( ) ) ;
144144}
145145
146146#[ compio_macros:: test]
@@ -193,9 +193,7 @@ async fn compat_ping_pong() {
193193 let mut ws = std:: pin:: pin!( ws) ;
194194
195195 let msg = ws. next ( ) . await . unwrap ( ) . unwrap ( ) ;
196- if let Message :: Ping ( data) = msg {
197- ws. send ( Message :: Pong ( data) ) . await . unwrap ( ) ;
198- }
196+ assert ! ( matches!( msg, Message :: Ping ( _) ) ) ;
199197 } )
200198 . detach ( ) ;
201199
You can’t perform that action at this time.
0 commit comments