mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-16 00:48:10 +00:00
Add a test for IP v6
This commit is contained in:
@ -85,7 +85,7 @@ impl fmt::Debug for Ipv6Network {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::net::Ipv4Addr;
|
||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
@ -93,4 +93,10 @@ mod test {
|
||||
let cidr = Ipv4Network::new(Ipv4Addr::new(77, 88, 21, 11), 24);
|
||||
assert_eq!(cidr.prefix(), 24);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_v6() {
|
||||
let cidr = Ipv6Network::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 24);
|
||||
assert_eq!(cidr.prefix(), 24);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user