test(error): increasing test coverage of error module 2

This commit is contained in:
Marius Seritan
2015-05-26 20:31:24 -07:00
parent 59d8e80e6c
commit b24e1a5e6c

View File

@@ -129,7 +129,9 @@ mod tests {
macro_rules! from { macro_rules! from {
($from:expr => $error:pat) => { ($from:expr => $error:pat) => {
match Error::from($from) { match Error::from($from) {
$error => (), e @ $error => {
assert!(e.description().len() > 5);
} ,
_ => panic!("{:?}", $from) _ => panic!("{:?}", $from)
} }
} }
@@ -155,7 +157,7 @@ mod tests {
from_and_cause!(url::ParseError::EmptyHost => Uri(..)); from_and_cause!(url::ParseError::EmptyHost => Uri(..));
from_and_cause!(SslError::SslSessionClosed => Ssl(..)); from_and_cause!(SslError::SslSessionClosed => Ssl(..));
from!(SslError::StreamError(io::Error::new(io::ErrorKind::Other, "ssl")) => Io(..)); from!(SslError::StreamError(io::Error::new(io::ErrorKind::Other, "ssl negotiation")) => Io(..));
from!(httparse::Error::HeaderName => Header); from!(httparse::Error::HeaderName => Header);