Added a regression test for sending raw messages (see #128).

This commit is contained in:
Aaron Weiss 2018-03-30 21:56:29 +02:00
parent 4ac8c699d6
commit 984fbe9ba8
No known key found for this signature in database
GPG key ID: 047D32DF25DC22EF

View file

@ -847,7 +847,7 @@ mod test {
#[cfg(not(feature = "nochanlists"))]
use client::data::User;
use proto::{ChannelMode, IrcCodec, Mode};
use proto::command::Command::{PART, PRIVMSG};
use proto::command::Command::{PART, PRIVMSG, Raw};
pub fn test_config() -> Config {
Config {
@ -1072,6 +1072,18 @@ mod test {
assert_eq!(&get_client_value(client)[..], "PRIVMSG #test :Hi there!\r\n");
}
#[test]
fn send_raw_is_really_raw() {
let client = IrcClient::from_config(test_config()).unwrap();
assert!(
client.send(Raw("PASS".to_owned(), vec!["password".to_owned()], None)).is_ok()
);
assert!(
client.send(Raw("NICK".to_owned(), vec!["test".to_owned()], None)).is_ok()
);
assert_eq!(&get_client_value(client)[..], "PASS password\r\nNICK test\r\n");
}
#[test]
#[cfg(not(feature = "nochanlists"))]
fn channel_tracking_names() {