Add a test for IP v6

This commit is contained in:
Abhishek Chanda
2015-04-17 19:51:12 -07:00
parent c74528309c
commit c8f81d9199

View File

@ -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);
}
}