diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-20 11:53:34 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-20 11:53:34 +0200 |
commit | 24d9f192e45434448734e8fb03f589618ea7363f (patch) | |
tree | b95c066f206de2952449b4b9e021e7d6a41db6c1 /tests/parsing-crates/mail_parser.rs | |
parent | 8c47687d8ebeb80771872864a41e38c9168773ca (diff) | |
download | aerogramme-24d9f192e45434448734e8fb03f589618ea7363f.tar.gz aerogramme-24d9f192e45434448734e8fb03f589618ea7363f.zip |
Start testing of mail parsing crates
Diffstat (limited to 'tests/parsing-crates/mail_parser.rs')
-rw-r--r-- | tests/parsing-crates/mail_parser.rs | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/tests/parsing-crates/mail_parser.rs b/tests/parsing-crates/mail_parser.rs new file mode 100644 index 0000000..165bace --- /dev/null +++ b/tests/parsing-crates/mail_parser.rs @@ -0,0 +1,73 @@ +use mail_parser_superboum::Message; // FAIL +//use mail_parser_048::Message; // PASS +//use mail_parser_05::Message; // PASS +//use mail_parser_main::Message; // PASS +//use mail_parser_db61a03::Message; // PASS + + +#[test] +fn test1() { + let input = br#"Content-Type: multipart/mixed; boundary="1234567890123456789012345678901234567890123456789012345678901234567890123456789012" + +--1234567890123456789012345678901234567890123456789012345678901234567890123456789012 +Content-Type: multipart/mixed; boundary="123456789012345678901234567890123456789012345678901234567890123456789012345678901" + +--123456789012345678901234567890123456789012345678901234567890123456789012345678901 +Content-Type: multipart/mixed; boundary="12345678901234567890123456789012345678901234567890123456789012345678901234567890" + +--12345678901234567890123456789012345678901234567890123456789012345678901234567890 +Content-Type: text/plain + +1 +--1234567890123456789012345678901234567890123456789012345678901234567890123456789012 +Content-Type: text/plain + +22 +--123456789012345678901234567890123456789012345678901234567890123456789012345678901 +Content-Type: text/plain + +333 +--12345678901234567890123456789012345678901234567890123456789012345678901234567890 +Content-Type: text/plain + +4444 +"#; + + let message = Message::parse(input); + dbg!(message); +} + + +#[test] +fn test2() { + let input = br#"Content-Type: message/rfc822 + +Content-Type: message/rfc822 + +Content-Type: text/plain + +1"#; + + let message = Message::parse(input); + dbg!(message); +} + +#[test] +fn test3() { +let input = br#"Content-Type: multipart/mixed; boundary=":foo" + +--:foo +--:foo +Content-Type: text/plain +--:foo +Content-Type: text/plain +--:foo +Content-Type: text/html +--:foo-- + + +"#; + + let message = Message::parse(input); + dbg!(message); +} |