We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de6390f commit 67ebf9bCopy full SHA for 67ebf9b
1 file changed
crates/core/src/types.rs
@@ -342,6 +342,24 @@ mod tests {
342
);
343
}
344
345
+ #[test]
346
+ fn test_cidr_contains_ipv6_default_route() {
347
+ let default: Cidr = "::/0".parse().unwrap();
348
+ let any: Cidr = "2001:db8::/32".parse().unwrap();
349
+ assert!(default.contains(&any), "::/0 should contain any IPv6 CIDR");
350
+ }
351
+
352
353
+ fn test_cidr_contains_ipv6_host_route() {
354
+ let net: Cidr = "fd00::/16".parse().unwrap();
355
+ let host: Cidr = "fd00::1/128".parse().unwrap();
356
+ assert!(net.contains(&host), "fd00::/16 should contain fd00::1/128");
357
+ assert!(
358
+ !host.contains(&net),
359
+ "fd00::1/128 should not contain fd00::/16"
360
+ );
361
362
363
#[test]
364
fn test_cidr_contains_mixed_families() {
365
let v4: Cidr = "10.0.0.0/8".parse().unwrap();
0 commit comments