mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-30 00:47:13 +00:00
test(utils): cover bracketed IPv6 zone host parsing (#3073)
This commit is contained in:
@@ -457,6 +457,15 @@ mod tests {
|
|||||||
assert_eq!(host.port, None);
|
assert_eq!(host.port, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_host_with_bracketed_ipv6_zone_and_port() {
|
||||||
|
let result = parse_host("[fe80::1%eth0]:9000");
|
||||||
|
assert!(result.is_ok());
|
||||||
|
let host = result.unwrap();
|
||||||
|
assert_eq!(host.name, "fe80::1%eth0");
|
||||||
|
assert_eq!(host.port, Some(9000));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_host_with_bracketed_ipv6_without_port() {
|
fn parse_host_with_bracketed_ipv6_without_port() {
|
||||||
let result = parse_host("[::1]");
|
let result = parse_host("[::1]");
|
||||||
|
|||||||
Reference in New Issue
Block a user