aboutsummaryrefslogtreecommitdiff
path: root/tests/parsing-crates/mail_parser.rs
blob: 165bace8ca5b6d1cbd8a674ee819d51d65eed60d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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);
}