Skip to content

Commit a012579

Browse files
committed
Handle set_ip_host failures
1 parent ed4829b commit a012579

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

url/tests/unit.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,9 @@ fn test_no_base_url() {
609609
assert!(no_base_url.path_segments().is_none());
610610
assert!(no_base_url.path_segments_mut().is_err());
611611
assert!(no_base_url.set_host(Some("foo")).is_err());
612-
assert!(no_base_url.set_ip_host("127.0.0.1".parse().unwrap()).is_err());
612+
assert!(no_base_url
613+
.set_ip_host("127.0.0.1".parse().unwrap())
614+
.is_err());
613615

614616
no_base_url.set_path("/foo");
615617
assert_eq!(no_base_url.path(), "%2Ffoo");
@@ -674,10 +676,10 @@ fn test_fragment() {
674676
fn test_set_ip_host() {
675677
let mut url = Url::parse("http://example.com").unwrap();
676678

677-
url.set_ip_host("127.0.0.1".parse().unwrap());
679+
url.set_ip_host("127.0.0.1".parse().unwrap()).unwrap();
678680
assert_eq!(url.host_str(), Some("127.0.0.1"));
679681

680-
url.set_ip_host("::1".parse().unwrap());
682+
url.set_ip_host("::1".parse().unwrap()).unwrap();
681683
assert_eq!(url.host_str(), Some("[::1]"));
682684
}
683685

0 commit comments

Comments
 (0)