diff --git a/Cargo.toml b/Cargo.toml index 524422c..5deabea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/parse.rs b/src/parse.rs index dbcb27f..7c79b59 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -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() {