diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-01-09 21:30:25 +0000 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-01-10 01:05:26 +0000 |
commit | fdb464b380dcda0f9afeee080ebe988e3934e02b (patch) | |
tree | b46ebdea03117f2f6f82e65a2542ae4b6e8f2e5d /libgitmail/tests/basic.rs | |
parent | ad1ad814ab2c4c89a3e8b6538f93c6c2b455efb3 (diff) |
Refactoring libgitmail core to work on complete emails, with tests
Diffstat (limited to 'libgitmail/tests/basic.rs')
-rw-r--r-- | libgitmail/tests/basic.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libgitmail/tests/basic.rs b/libgitmail/tests/basic.rs new file mode 100644 index 0000000..0271784 --- /dev/null +++ b/libgitmail/tests/basic.rs @@ -0,0 +1,26 @@ +#![allow(warnings, unused)] + +use libgitmail::{Id, Patch, Segment, Subject}; + +const TEST_MAIL: &'static str = include_str!("../email.txt"); + +/// Parse an e-mail that was generated by git-send-email in a real projectf +#[test] +fn parse_mail() { + let headers = Patch::preprocess(TEST_MAIL); + assert_eq!( + Patch::new(TEST_MAIL).unwrap(), + Patch { + id: Id("<20191229132404.14579-1-hi@alyssa.is>".into()), + headers, + raw: TEST_MAIL, + reply_to: None, + subject: Subject { + version: 1, + segment: None, + prefix: "PATCH".into(), + message: "docs: Node.js 10 works fine (now?)".into() + } + } + ) +} |