mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 23:36:30 +03:00
Test that internal "prefer-encrypt=reset" value is not parsed from header
This is a test for bugfix e8f2f7b24e
This commit is contained in:
committed by
Floris Bruynooghe
parent
cddfd04a7f
commit
91f1d793e9
@@ -191,6 +191,19 @@ mod tests {
|
|||||||
assert_eq!(h.prefer_encrypt, EncryptPreference::Mutual);
|
assert_eq!(h.prefer_encrypt, EncryptPreference::Mutual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EncryptPreference::Reset is an internal value, parser should never return it
|
||||||
|
#[test]
|
||||||
|
fn test_from_str_reset() {
|
||||||
|
let raw = format!(
|
||||||
|
"addr=reset@example.com; prefer-encrypt=reset; keydata={}",
|
||||||
|
RAWKEY
|
||||||
|
);
|
||||||
|
let h: Aheader = raw.parse().expect("failed to parse");
|
||||||
|
|
||||||
|
assert_eq!(h.addr, "reset@example.com");
|
||||||
|
assert_eq!(h.prefer_encrypt, EncryptPreference::NoPreference);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_str_non_critical() {
|
fn test_from_str_non_critical() {
|
||||||
let raw = format!("addr=me@mail.com; _foo=one; _bar=two; keydata={}", RAWKEY);
|
let raw = format!("addr=me@mail.com; _foo=one; _bar=two; keydata={}", RAWKEY);
|
||||||
|
|||||||
Reference in New Issue
Block a user