Lite/t/v4-badnm.t

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 96.5% 28 / 29 CC 1 SCAR 0.0
CC
1
Cov
96%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Lite/t/within.t ↑ Summary Lite/t/constants.t »
1 # I know this does not look like -*- perl -*-, but I swear it is...
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 $| = 1;
7  
8 1 my @badnets = (
9 '10.10.10.10/255.255.0.255',
10 '10.10.10.10/255.0.255.255',
11 '10.10.10.10/0.255.255.255',
12 '10.10.10.10/128.255.0.255',
13 '10.10.10.10/255.128.0.255',
14 '10.10.10.10/255.255.255.129',
15 '10.10.10.10/255.255.129.0',
16 '10.10.10.10/255.255.255.130',
17 '10.10.10.10/255.255.130.0',
18 '10.10.10.10/255.0.0.1',
19 '10.10.10.10/255.129.0.1',
20 '10.10.10.10/0.255.0.255',
21 '58.26.0.0-58.27.127.255', # Taken from APNIC's WHOIS case
22 );
23  
24 1 my @goodnets = ();
25  
26 1 push @goodnets, "10.0.0.1/$_" for (0 .. 32);
27 1 push @goodnets, "10.0.0.1/255.255.255.255";
28  
29 1 plan tests => 1 + @badnets + @goodnets;
30  
31 1 ▶die "# Cannot continue without NetAddr::IP::Lite\n"
Subroutine BEGIN: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
unless &use_ok("NetAddr::IP::Lite") 0 1 1
32 unless use_ok('NetAddr::IP::Lite');
33  
34 1 my $count = 1;
35  
36 ok(! defined NetAddr::IP::Lite->new($_), "new $_ should fail")
37 1 for @badnets;
38  
39 ok(defined NetAddr::IP::Lite->new($_), "new $_ should work")
40 1 for @goodnets;
41  
42  
« Lite/t/within.t ↑ Summary Lite/t/constants.t »