Cleaned up a bit of testing code.
This commit is contained in:
parent
9b99677391
commit
cabe0919c8
1 changed files with 8 additions and 7 deletions
|
@ -861,6 +861,7 @@ mod test {
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use super::{IrcClient, Client};
|
use super::{IrcClient, Client};
|
||||||
|
use error::IrcError;
|
||||||
use client::data::Config;
|
use client::data::Config;
|
||||||
#[cfg(not(feature = "nochanlists"))]
|
#[cfg(not(feature = "nochanlists"))]
|
||||||
use client::data::User;
|
use client::data::User;
|
||||||
|
@ -1054,11 +1055,11 @@ mod test {
|
||||||
let res = client.for_each_incoming(|message| {
|
let res = client.for_each_incoming(|message| {
|
||||||
println!("{:?}", message);
|
println!("{:?}", message);
|
||||||
});
|
});
|
||||||
use error::IrcError;
|
|
||||||
match res.expect_err("returned no error when no valid nicks were specified") {
|
|
||||||
IrcError::NoUsableNick => (),
|
|
||||||
_ => panic!("expected {} error when no valid nicks are specified"),
|
|
||||||
|
|
||||||
|
if let Err(IrcError::NoUsableNick) = res {
|
||||||
|
()
|
||||||
|
} else {
|
||||||
|
panic!("expected error when no valid nicks were specified")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1268,7 +1269,7 @@ mod test {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
&get_client_value(client)[..],
|
&get_client_value(client)[..],
|
||||||
"NOTICE test :\u{001}SOURCE https://github.com/aatxe/irc\u{001}\r\n\
|
"NOTICE test :\u{001}SOURCE https://github.com/aatxe/irc\u{001}\r\n\
|
||||||
NOTICE test :\u{001}SOURCE\u{001}\r\n"
|
NOTICE test :\u{001}SOURCE\u{001}\r\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue