Fix http::tests

This commit is contained in:
2021-05-20 20:20:29 +02:00
parent fb4a78f23f
commit 2dc783bf66
2 changed files with 15 additions and 2 deletions

View File

@ -90,6 +90,13 @@ impl fmt::Display for Error {
}
}
impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.fmt(f);
Ok(())
}
}
impl From<std::io::Error> for Error {
fn from(error: std::io::Error) -> Self {
Error {

View File

@ -324,7 +324,10 @@ mod tests {
let mut parser = super::Parser::new_request_parser(request.as_bytes());
match parser.parse() {
Ok(_v) => panic!("should fail"),
Err(e) => assert_eq!("invalid character at position 13", e),
Err(e) => assert_eq!(
"unable to parse http request: invalid character at position 13",
e.to_string()
),
}
}
@ -334,7 +337,10 @@ mod tests {
let mut parser = super::Parser::new_request_parser(request.as_bytes());
match parser.parse() {
Ok(_v) => panic!("should fail"),
Err(e) => assert_eq!("input too short", e),
Err(e) => assert_eq!(
"unable to parse http request: input too short",
e.to_string()
),
}
}