~asimpson/mailpreview-cli

90634c0e1154ad0b9a7243eed9d491bb2d7a3090 — Adam Simpson 1 year, 5 months ago cd3871f
test: add simple email test
1 files changed, 10 insertions(+), 0 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +10 -0
@@ 57,6 57,16 @@ mod tests {
    use super::*;

    #[test]
    fn simple() {
        let body = "Content-Type: text/plain

hello!";
        let mail = parse_mail(body.as_bytes()).unwrap();
        let body = return_body(mail, "text/plain".to_string()).unwrap();
        assert_eq!(body.trim(), "hello!");
    }

    #[test]
    fn multipart_mixed() {
        let body = "Content-Type: multipart/mixed;
	boundary=\"mixed\"