Skip to content

Commit 6dccb58

Browse files
author
zeroed
committed
Extend the tests in 'Response' to cover a failed validation
1 parent 6d8df9c commit 6dccb58

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/response.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,15 @@ impl<'a> IntoIterator for &'a mut Response {
656656
#[cfg(test)]
657657
mod test {
658658
use super::Response;
659+
659660
#[test]
660-
fn construct_shorthand() {
661+
fn construct_shorthand_with_valid_status_code() {
661662
let _res = Response::new(200);
662663
}
664+
665+
#[test]
666+
#[should_panic(expected = "Could not convert into a valid `StatusCode`")]
667+
fn construct_shorthand_with_invalid_status_code() {
668+
let _res = Response::new(600);
669+
}
663670
}

0 commit comments

Comments
 (0)