Fix unit tests

This commit is contained in:
Quentin 2024-01-12 09:54:58 +01:00
parent 3c7186ab5a
commit 6963287986
Signed by: quentin
GPG key ID: E9602264D639FF68
2 changed files with 6 additions and 3 deletions

View file

@ -612,6 +612,7 @@ mod tests {
peek: false, peek: false,
}, },
]), ]),
&[],
false, false,
); );
@ -623,12 +624,13 @@ mod tests {
rfc822_size: 8usize, rfc822_size: 8usize,
}; };
let index_entry = (NonZeroU32::MIN, vec![]); let index_entry = (NonZeroU32::MIN, NonZeroU64::MIN, vec![]);
let mail_in_idx = MailIndex { let mail_in_idx = MailIndex {
i: NonZeroU32::MIN, i: NonZeroU32::MIN,
uid: index_entry.0, uid: index_entry.0,
modseq: index_entry.1,
uuid: unique_ident::gen_ident(), uuid: unique_ident::gen_ident(),
flags: &index_entry.1, flags: &index_entry.2,
}; };
let rfc822 = b"Subject: hello\r\nFrom: a@a.a\r\nTo: b@b.b\r\nDate: Thu, 12 Oct 2023 08:45:28 +0000\r\n\r\nhello world"; let rfc822 = b"Subject: hello\r\nFrom: a@a.a\r\nTo: b@b.b\r\nDate: Thu, 12 Oct 2023 08:45:28 +0000\r\n\r\nhello world";
let qr = QueryResult::FullResult { let qr = QueryResult::FullResult {

View file

@ -393,6 +393,7 @@ mod tests {
assert_eq!(state.table.len(), 1); assert_eq!(state.table.len(), 1);
let (uid, modseq, flags) = state.table.get(&m).unwrap(); let (uid, modseq, flags) = state.table.get(&m).unwrap();
assert_eq!(*uid, NonZeroU32::new(1).unwrap()); assert_eq!(*uid, NonZeroU32::new(1).unwrap());
assert_eq!(*modseq, NonZeroU64::new(1).unwrap());
assert_eq!(flags.len(), 2); assert_eq!(flags.len(), 2);
let ident = state.idx_by_uid.get(&NonZeroU32::new(1).unwrap()).unwrap(); let ident = state.idx_by_uid.get(&NonZeroU32::new(1).unwrap()).unwrap();
assert_eq!(&m, ident); assert_eq!(&m, ident);
@ -447,7 +448,7 @@ mod tests {
{ {
let m = UniqueIdent([0x03; 24]); let m = UniqueIdent([0x03; 24]);
let f = vec!["\\Archive".to_string(), "\\Recent".to_string()]; let f = vec!["\\Archive".to_string(), "\\Recent".to_string()];
let ev = UidIndexOp::MailAdd(m, NonZeroU32::new(1).unwrap(), NonZeroU32::new(1).unwrap(), f); let ev = UidIndexOp::MailAdd(m, NonZeroU32::new(1).unwrap(), NonZeroU64::new(1).unwrap(), f);
state = state.apply(&ev); state = state.apply(&ev);
} }