Update imap-proto and test that "IMAP4REV1" capability is accepted

See issue https://github.com/djc/tokio-imap/issues/54
This commit is contained in:
Alexander Krotov 2019-09-04 13:48:22 +03:00
parent 6c9611ff3a
commit 2221cd2e18
No known key found for this signature in database
GPG key ID: A0E750E8040BC161
2 changed files with 17 additions and 2 deletions

View file

@ -25,8 +25,8 @@ is-it-maintained-open-issues = { repository = "jonhoo/rust-imap" }
native-tls = "0.2.2"
regex = "1.0"
bufstream = "0.1"
imap-proto = "0.8"
nom = "4.0"
imap-proto = "0.9.0"
nom = "5.0"
base64 = "0.10"
chrono = "0.4"
lazy_static = "1.4"

View file

@ -351,6 +351,21 @@ mod tests {
}
}
#[test]
fn parse_capability_case_insensitive_test() {
// Test that "IMAP4REV1" (instead of "IMAP4rev1") is accepted
let expected_capabilities = vec!["IMAP4rev1", "STARTTLS"];
let lines = b"* CAPABILITY IMAP4REV1 STARTTLS\r\n";
let (mut send, recv) = mpsc::channel();
let capabilities = parse_capabilities(lines.to_vec(), &mut send).unwrap();
// shouldn't be any unexpected responses parsed
assert!(recv.try_recv().is_err());
assert_eq!(capabilities.len(), 2);
for e in expected_capabilities {
assert!(capabilities.has_str(e));
}
}
#[test]
#[should_panic]
fn parse_capability_invalid_test() {