From 084675fdfe1329cbd58a48f2306b7c61dec08834 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Fri, 15 Nov 2019 20:12:59 +0100 Subject: more tests for tags --- tests/fixtures.rs | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'tests/fixtures.rs') diff --git a/tests/fixtures.rs b/tests/fixtures.rs index c9e04c8..a8166be 100644 --- a/tests/fixtures.rs +++ b/tests/fixtures.rs @@ -147,16 +147,41 @@ impl MailBox { if seen { flags += "S"; } - self.maildir.store_cur_with_flags(&msg.message_to_string().unwrap().as_bytes(), flags.as_str()).unwrap() - }; + println!("flags: {:?}", flags); + let mid = self.maildir.store_cur_with_flags(&msg.message_to_string().unwrap().as_bytes(), flags.as_str()).unwrap(); + // I have no idea what the reasoning for the :2 here is, but ok. + format!("{}:2,{}", mid, flags) + }; + + // let mut flags = String::from(""); + // if flagged { + // flags += "F"; + // } + // if replied { + // flags += "R"; + // } + // if seen { + // flags += "S"; + // } + // println!("flags: {:?}", flags); + // let id = self.maildir.store_cur_with_flags(&msg.message_to_string().unwrap().as_bytes(), flags.as_str()).unwrap(); + + // if is_new { + // let msgpath = format!("{}{}", id, flags); + // std::fs::rename(msgpath, newpath)?; + + // self.maildir.path() + // } + + let mut msgpath = self.path(); msgpath = if is_new { msgpath.join("new") } else { msgpath.join("cur") }; - + msgpath = msgpath.join(&id); Ok((msg_id, msgpath)) -- cgit v1.2.1