File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -2014,15 +2014,19 @@ mod tests {
20142014 F : ' a + FnOnce ( Arc < Mutex < Session < MockStream > > > , & ' a str , & ' a str ) -> K ,
20152015 K : ' a + Future < Output = Result < T > > ,
20162016 {
2017- generic_with_uid (
2018- "A0001 OK COPY completed\r \n " ,
2019- "COPY" ,
2020- "2:4" ,
2021- "MEETING" ,
2022- prefix,
2023- op,
2024- )
2025- . await ;
2017+ let resp = "A0001 OK COPY completed\r \n " . as_bytes ( ) . to_vec ( ) ;
2018+ let seq = "2:4" ;
2019+ let query = "MEETING" ;
2020+ let line = format ! ( "A0001{prefix}COPY {seq} {}\r \n " , quote!( query) ) ;
2021+ let session = Arc :: new ( Mutex :: new ( mock_session ! ( MockStream :: new( resp) ) ) ) ;
2022+
2023+ {
2024+ let _ = op ( session. clone ( ) , seq, query) . await . unwrap ( ) ;
2025+ }
2026+ assert ! (
2027+ session. lock( ) . await . stream. inner. written_buf == line. as_bytes( ) . to_vec( ) ,
2028+ "Invalid command"
2029+ ) ;
20262030 }
20272031
20282032 #[ cfg_attr( feature = "runtime-tokio" , tokio:: test) ]
You can’t perform that action at this time.
0 commit comments