Fix http::tests
This commit is contained in:
@ -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 {
|
impl From<std::io::Error> for Error {
|
||||||
fn from(error: std::io::Error) -> Self {
|
fn from(error: std::io::Error) -> Self {
|
||||||
Error {
|
Error {
|
||||||
|
@ -324,7 +324,10 @@ mod tests {
|
|||||||
let mut parser = super::Parser::new_request_parser(request.as_bytes());
|
let mut parser = super::Parser::new_request_parser(request.as_bytes());
|
||||||
match parser.parse() {
|
match parser.parse() {
|
||||||
Ok(_v) => panic!("should fail"),
|
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());
|
let mut parser = super::Parser::new_request_parser(request.as_bytes());
|
||||||
match parser.parse() {
|
match parser.parse() {
|
||||||
Ok(_v) => panic!("should fail"),
|
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()
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user