Browse Source

Fix test errors and warnings

master
Manos Pitsidianakis 2 weeks ago
parent
commit
a7c0bca8ce
Signed by: epilys GPG Key ID: 73627C2F690DF710
5 changed files with 6 additions and 11 deletions
  1. +0
    -6
      melib/src/email/compose.rs
  2. +1
    -1
      melib/src/email/compose/mime.rs
  3. +3
    -3
      melib/src/email/parser.rs
  4. +1
    -1
      tests/generated_email.eml
  5. +1
    -0
      tools/src/smtp_conn.rs

+ 0
- 6
melib/src/email/compose.rs View File

@ -324,14 +324,12 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
Text { .. } => {
for line in a.build().into_raw().lines() {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
Multipart {
boundary: _,
@ -346,7 +344,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
.map(|s| s.into())
.collect::<Vec<AttachmentBuilder>>(),
);
ret.push_str("\r\n");
}
MessageRfc822 => {
ret.push_str(&format!(
@ -359,7 +356,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
PGPSignature => {
ret.push_str(&format!(
@ -373,7 +369,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str(line);
ret.push_str("\r\n");
}
ret.push_str("\r\n");
}
_ => {
let content_transfer_encoding: ContentTransferEncoding = if a.raw().is_ascii() {
@ -410,7 +405,6 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) {
ret.push_str("\r\n");
}
}
ret.push_str("\r\n");
}
}
}

+ 1
- 1
melib/src/email/compose/mime.rs View File

@ -179,7 +179,7 @@ fn test_encode_header() {
)
.unwrap(),
);
let words = "[Advcomparch] =?utf-8?b?zqPPhc68z4DOtc+BzrnPhs6/z4HOrCDPg861IGZs?=\n\t=?utf-8?b?dXNoIM67z4zOs8+JIG1pc3ByZWRpY3Rpb24gzrrOsc+Ezqwgz4TOt869?=\n\t=?utf-8?b?IM61zrrPhM6tzrvOtc+Dzrcgc3RvcmU=?=";
//let words = "[Advcomparch] =?utf-8?b?zqPPhc68z4DOtc+BzrnPhs6/z4HOrCDPg861IGZs?=\n\t=?utf-8?b?dXNoIM67z4zOs8+JIG1pc3ByZWRpY3Rpb24gzrrOsc+Ezqwgz4TOt869?=\n\t=?utf-8?b?IM61zrrPhM6tzrvOtc+Dzrcgc3RvcmU=?=";
let words_enc = "[Advcomparch] Συμπεριφορά σε flush λόγω misprediction κατά την εκτέλεση store";
assert_eq!(
"[Advcomparch] Συμπεριφορά σε flush λόγω misprediction κατά την εκτέλεση store",

+ 3
- 3
melib/src/email/parser.rs View File

@ -1200,8 +1200,8 @@ List-Archive: (Web Archive)
"#;
let (rest, headers) = headers::headers(s.as_bytes()).unwrap();
assert!(rest.is_empty());
for (h, v) in headers {
let (rest, action_list) = rfc_2369_list_headers_action_list(v).unwrap();
for (_h, v) in headers {
let (rest, _action_list) = rfc_2369_list_headers_action_list(v).unwrap();
assert!(rest.is_empty());
}
}
@ -2486,7 +2486,7 @@ pub mod address {
#[cfg(test)]
mod tests {
use super::{address::*, encodings::*, generic::*, *};
use super::{address::*, encodings::*, *};
use crate::email::address::*;
use crate::make_address;

+ 1
- 1
tests/generated_email.eml View File

@ -38,4 +38,4 @@ XKKGGn7Akph/8XX2WDTTcAYfguVt9hhrEPqmzIOJ3VUheb48WJiHG6amC4i+WVJKKCimqGIoYxyj
WWK8kKjaJ9bA18sxvXjYhourmbbMMrjI+OIn1QymDCVXANGFK4S1gQw0PxozzC+33FLLKUJq9gk1
gyWDhyNwrMLkYGUEM4wvuLRiCiieXIJJJVlmJskcZ9TZRht1lnFGGmTMkMoonVQSSSOFAGJHHI0w
ouiijDaaCCGQRgrpH3q4QYYXWDihxBE+7KCDDjnUIEVAADs=
--bzz_bzz__bzz__--
--bzz_bzz__bzz__--

+ 1
- 0
tools/src/smtp_conn.rs View File

@ -17,6 +17,7 @@ fn main() -> Result<()> {
username: "username".into(),
password: Password::CommandEval("gpg2 --no-tty -q -d ~/.passwords/password.gpg".into()),
require_auth: true,
auth_type: Default::default(),
},
envelope_from: String::new(),
};

Loading…
Cancel
Save