summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/net.rs b/src/net.rs
index cfb902b6b6..fb119ea8af 100644
--- a/src/net.rs
+++ b/src/net.rs
@@ -203,27 +203,32 @@ mod remote_addr_tests {
#[test]
fn from_ipv6_str_without_port() {
- assert!(RemoteAddr::from_str("fe80::1").is_err());
+ let result = RemoteAddr::from_str("fe80::1");
+ assert_matches!(result, Err(Error(ErrorKind::AddrParse(_), _)));
}
#[test]
fn from_str_no_colon() {
- assert!(RemoteAddr::from_str("example.com").is_err());
+ let result = RemoteAddr::from_str("example.com");
+ assert_matches!(result, Err(Error(ErrorKind::AddrParse(_), _)));
}
#[test]
fn from_str_invalid_port_large() {
- assert!(RemoteAddr::from_str("example.com:99999").is_err());
+ let result = RemoteAddr::from_str("example.com:99999");
+ assert_matches!(result, Err(Error(ErrorKind::AddrParse(_), _)));
}
#[test]
fn from_str_empty_address() {
- assert!(RemoteAddr::from_str(":100").is_err());
+ let result = RemoteAddr::from_str(":100");
+ assert_matches!(result, Err(Error(ErrorKind::AddrParse(_), _)));
}
#[test]
fn from_str_empty_port() {
- assert!(RemoteAddr::from_str("example.com:").is_err());
+ let result = RemoteAddr::from_str("example.com:");
+ assert_matches!(result, Err(Error(ErrorKind::AddrParse(_), _)));
}
#[test]