Add tests for messages with a leading colon in the suffix
This commit is contained in:
parent
0179b46c5d
commit
b64a71e2fa
1 changed files with 25 additions and 0 deletions
|
@ -547,4 +547,29 @@ mod test {
|
|||
let message = "@tag=\\:\\s\\\\\\r\\na :test PRIVMSG #test test\r\n";
|
||||
assert_eq!(msg, message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_message_with_colon_in_suffix() {
|
||||
let msg = "PRIVMSG #test ::test"
|
||||
.parse::<Message>()
|
||||
.unwrap();
|
||||
let message = Message {
|
||||
tags: None,
|
||||
prefix: None,
|
||||
command: PRIVMSG("#test".to_string(), ":test".to_string())
|
||||
};
|
||||
assert_eq!(msg, message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn to_string_with_colon_in_suffix() {
|
||||
let msg = Message {
|
||||
tags: None,
|
||||
prefix: None,
|
||||
command: PRIVMSG("#test".to_string(), ":test".to_string()),
|
||||
}
|
||||
.to_string();
|
||||
let message = "PRIVMSG #test ::test\r\n";
|
||||
assert_eq!(msg, message);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue