From 8be787387c90065d3302f54f9a1dd9ee1b71afed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Sun, 24 May 2026 11:18:56 +0800 Subject: [PATCH] test(utils): cover bracketed IPv6 zone host parsing (#3073) --- crates/utils/src/notify/net.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/utils/src/notify/net.rs b/crates/utils/src/notify/net.rs index befe4b193..178ff4089 100644 --- a/crates/utils/src/notify/net.rs +++ b/crates/utils/src/notify/net.rs @@ -457,6 +457,15 @@ mod tests { 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] fn parse_host_with_bracketed_ipv6_without_port() { let result = parse_host("[::1]");