Add unit tests to raise coverage score

Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
YUAN LYU
2021-04-02 15:29:21 -04:00
committed by Adrian Catangiu
parent 9e6ab4b5ab
commit 49240ce1d5
4 changed files with 30 additions and 1 deletions

View File

@@ -383,4 +383,15 @@ mod tests {
response.allow_method(Method::Put);
assert_eq!(response.allow(), vec![Method::Get, Method::Put]);
}
#[test]
fn test_equal() {
let response = Response::new(Version::Http10, StatusCode::MethodNotAllowed);
let another_response = Response::new(Version::Http10, StatusCode::MethodNotAllowed);
assert_eq!(response, another_response);
let response = Response::new(Version::Http10, StatusCode::OK);
let another_response = Response::new(Version::Http10, StatusCode::BadRequest);
assert_ne!(response, another_response);
}
}