File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ named!(pub section_part<Vec<u32>>, do_parse!(
1515) ) ;
1616
1717named ! ( pub section_msgtext<MessageSection >, alt!(
18+ do_parse!(
19+ tag_no_case!( "HEADER.FIELDS" ) >>
20+ opt!( tag_no_case!( ".NOT" ) ) >>
21+ tag!( " " ) >>
22+ parenthesized_list!( astring) >>
23+ ( MessageSection :: Header ) ) |
1824 do_parse!( tag_no_case!( "HEADER" ) >> ( MessageSection :: Header ) ) |
1925 do_parse!( tag_no_case!( "TEXT" ) >> ( MessageSection :: Text ) )
2026) ) ;
Original file line number Diff line number Diff line change @@ -674,6 +674,16 @@ mod tests {
674674 }
675675 }
676676
677+ #[ test]
678+ fn test_header_fields ( ) {
679+ const RESPONSE : & [ u8 ] = b"* 1 FETCH (UID 1 BODY[HEADER.FIELDS (CHAT-VERSION)] {21}\r \n Chat-Version: 1.0\r \n \r \n )\r \n " ;
680+
681+ match parse_response ( RESPONSE ) {
682+ Ok ( ( _, Response :: Fetch ( _, _) ) ) => { } ,
683+ rsp => panic ! ( "unexpected response {:?}" , rsp) ,
684+ }
685+ }
686+
677687 #[ test]
678688 fn test_opt_addresses ( ) {
679689 let addr = b"((NIL NIL \" minutes\" \" CNRI.Reston.VA.US\" ) (\" John Klensin\" NIL \" KLENSIN\" \" MIT.EDU\" )) " ;
You can’t perform that action at this time.
0 commit comments