t/masklen.t | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | n/a | ||
branch | n/a | ||
condition | n/a | ||
subroutine | n/a | ||
pod | n/a | ||
total | n/a |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | use NetAddr::IP; | ||||||
2 | |||||||
3 | # $Id: masklen.t,v 1.1.1.1 2006/08/14 15:36:06 lem Exp $ | ||||||
4 | |||||||
5 | my @masks = 0 .. 32; | ||||||
6 | |||||||
7 | $| = 1; | ||||||
8 | |||||||
9 | print '1..', scalar @masks, "\n"; | ||||||
10 | |||||||
11 | my $count = 1; | ||||||
12 | |||||||
13 | for my $m (@masks) { | ||||||
14 | my $ip = new NetAddr::IP '10.0.0.1', $m; | ||||||
15 | if ($ip->masklen == $m) { | ||||||
16 | print "ok ", $count ++, "\n"; | ||||||
17 | } | ||||||
18 | else { | ||||||
19 | print "not ok ", $count ++, "\n"; | ||||||
20 | } | ||||||
21 | } |