File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,28 @@ mod tests {
504504 assert_eq ! ( fetches[ 0 ] . uid, Some ( 74 ) ) ;
505505 }
506506
507+ #[ test]
508+ fn parse_fetches_w_dovecot_info ( ) {
509+ // Dovecot will sometimes send informational unsolicited
510+ // OK messages while performing long operations.
511+ // * OK Searched 91% of the mailbox, ETA 0:01
512+ let lines = b"\
513+ * OK Searched 91% of the mailbox, ETA 0:01\r \n \
514+ * 37 FETCH (UID 74)\r \n ";
515+ let ( mut send, recv) = mpsc:: channel ( ) ;
516+ let fetches = parse_fetches ( lines. to_vec ( ) , & mut send) . unwrap ( ) ;
517+ assert_eq ! (
518+ recv. try_recv( ) ,
519+ Ok ( UnsolicitedResponse :: Ok {
520+ code: None ,
521+ information: Some ( String :: from( "Searched 91% of the mailbox, ETA 0:01" ) ) ,
522+ } )
523+ ) ;
524+ assert_eq ! ( fetches. len( ) , 1 ) ;
525+ assert_eq ! ( fetches[ 0 ] . message, 37 ) ;
526+ assert_eq ! ( fetches[ 0 ] . uid, Some ( 74 ) ) ;
527+ }
528+
507529 #[ test]
508530 fn parse_names_w_unilateral ( ) {
509531 let lines = b"\
You can’t perform that action at this time.
0 commit comments