Skip to content

Commit 8a4bae6

Browse files
mmiratedjc
authored andcommitted
Linebreak and indent the BODYSTRUCTURE test data
1 parent d9aac99 commit 8a4bae6

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

imap-proto/src/parser/tests.rs

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
//use core::num::dec2flt::parse;
2-
use std::num::NonZeroUsize;
3-
41
use super::{bodystructure::BodyStructParser, parse_response};
52
use crate::types::*;
3+
use std::num::NonZeroUsize;
64

75
#[test]
86
fn test_mailbox_data_response() {
@@ -440,10 +438,43 @@ fn test_uidplus() {
440438

441439
#[test]
442440
fn test_imap_body_structure() {
443-
let mut test = br#"* 1569 FETCH (BODYSTRUCTURE (((("TEXT" "PLAIN" ("CHARSET" "ISO-8859-1") NIL NIL "QUOTED-PRINTABLE" 833 30 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "ISO-8859-1") NIL NIL "QUOTED-PRINTABLE" 3412 62 NIL ("INLINE" NIL) NIL) "ALTERNATIVE" ("BOUNDARY" "2__=fgrths") NIL NIL)("IMAGE" "GIF" ("NAME" "485039.gif") "<2__=lgkfjr>" NIL "BASE64" 64 NIL ("INLINE" ("FILENAME" "485039.gif")) NIL) "RELATED" ("BOUNDARY" "1__=fgrths") NIL NIL)("APPLICATION" "PDF" ("NAME" "title.pdf") "<1__=lgkfjr>" NIL "BASE64" 333980 NIL ("ATTACHMENT" ("FILENAME" "title.pdf")) NIL) "MIXED" ("BOUNDARY" "0__=fgrths") NIL NIL))"#.to_vec();
444-
test.extend_from_slice(b"\r\n");
445-
446-
let (_, resp) = parse_response(&test).unwrap();
441+
let test = b"\
442+
* 1569 FETCH (\
443+
BODYSTRUCTURE (\
444+
(\
445+
(\
446+
(\
447+
\"TEXT\" \"PLAIN\" \
448+
(\"CHARSET\" \"ISO-8859-1\") NIL NIL \
449+
\"QUOTED-PRINTABLE\" 833 30 NIL NIL NIL\
450+
)\
451+
(\
452+
\"TEXT\" \"HTML\" \
453+
(\"CHARSET\" \"ISO-8859-1\") NIL NIL \
454+
\"QUOTED-PRINTABLE\" 3412 62 NIL \
455+
(\"INLINE\" NIL) NIL\
456+
) \
457+
\"ALTERNATIVE\" (\"BOUNDARY\" \"2__=fgrths\") NIL NIL\
458+
)\
459+
(\
460+
\"IMAGE\" \"GIF\" \
461+
(\"NAME\" \"485039.gif\") \"<2__=lgkfjr>\" NIL \
462+
\"BASE64\" 64 NIL (\"INLINE\" (\"FILENAME\" \"485039.gif\")) \
463+
NIL\
464+
) \
465+
\"RELATED\" (\"BOUNDARY\" \"1__=fgrths\") NIL NIL\
466+
)\
467+
(\
468+
\"APPLICATION\" \"PDF\" \
469+
(\"NAME\" \"title.pdf\") \
470+
\"<1__=lgkfjr>\" NIL \"BASE64\" 333980 NIL \
471+
(\"ATTACHMENT\" (\"FILENAME\" \"title.pdf\")) NIL\
472+
) \
473+
\"MIXED\" (\"BOUNDARY\" \"0__=fgrths\") NIL NIL\
474+
)\
475+
)\r\n";
476+
477+
let (_, resp) = parse_response(test).unwrap();
447478
match resp {
448479
Response::Fetch(_, f) => {
449480
let bodystructure = f

0 commit comments

Comments
 (0)