mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Restore newlines and remove semicolon in test_parse_first_addr
This commit is contained in:
committed by
holger krekel
parent
f6660af014
commit
4529c326c6
@@ -1130,8 +1130,8 @@ mod tests {
|
|||||||
fn test_parse_first_addr() {
|
fn test_parse_first_addr() {
|
||||||
let context = dummy_context();
|
let context = dummy_context();
|
||||||
let raw = b"From: hello@one.org, world@two.org\n\
|
let raw = b"From: hello@one.org, world@two.org\n\
|
||||||
Chat-Disposition-Notification-To: wrong
|
Chat-Disposition-Notification-To: wrong\n\
|
||||||
Content-Type: text/plain;
|
Content-Type: text/plain\n\
|
||||||
Chat-Version: 1.0\n\
|
Chat-Version: 1.0\n\
|
||||||
\n\
|
\n\
|
||||||
test1\n\
|
test1\n\
|
||||||
@@ -1142,8 +1142,13 @@ mod tests {
|
|||||||
let of = mimeparser.parse_first_addr(HeaderDef::From_).unwrap();
|
let of = mimeparser.parse_first_addr(HeaderDef::From_).unwrap();
|
||||||
assert_eq!(of, mailparse::addrparse("hello@one.org").unwrap()[0]);
|
assert_eq!(of, mailparse::addrparse("hello@one.org").unwrap()[0]);
|
||||||
|
|
||||||
let of = mimeparser.parse_first_addr(HeaderDef::ChatDispositionNotificationTo);
|
// XXX: the address does not contain "@", so it is wrong
|
||||||
assert!(of.is_none());
|
// addr-spec according to RFC 2822, but mailparse still parses
|
||||||
|
// is as an address.
|
||||||
|
let of = mimeparser
|
||||||
|
.parse_first_addr(HeaderDef::ChatDispositionNotificationTo)
|
||||||
|
.unwrap();
|
||||||
|
assert_eq!(of, mailparse::addrparse("wrong").unwrap()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user