avoid misleading message

Closes #61
This commit is contained in:
Tshepang Lekhonkhobe
2017-10-09 11:59:48 +02:00
parent 5f5d985e7d
commit 124330be88
3 changed files with 16 additions and 2 deletions

View File

@ -308,6 +308,12 @@ mod test {
assert_eq!(None, cidr);
}
#[test]
fn parse_v4_fail_two_slashes() {
let cidr: Option<Ipv4Network> = "10.1.1.1/24/".parse().ok();
assert_eq!(None, cidr);
}
#[test]
fn size_v4_24bit() {
let net: Ipv4Network = "0/24".parse().unwrap();