Lite/t/numeric.t

filter: Statementstmt 100% 21 / 21 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 90.6% 29 / 32 CC 1 SCAR 0.0
CC
1
Cov
90%
BEGIN
1.0
BEGIN
1.0
ok
1.0
CRAP 1.0
« Lite/t/v6-cnew.t ↑ Summary Lite/t/broadcast.t »
1  
2 #use diagnostics;
3 1 ▶use NetAddr::IP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 $| = 1;
6  
7 1 print "1..6\n";
8  
9 1 my $test = 1;
10 6 ▶sub ok() {
Subroutine ok: called CC=1 SCAR=0.0
11 6 print 'ok ',$test++,"\n";
12 }
13  
14 1 my @tval = qw # IP bcd mask bcd
15 ( 8000:0:0:0:0:0:0:1/112 170141183460469231731687303715884105729 340282366920938463463374607431768145920
16 1.2.3.4/24 16909060 4294967040
17 );
18  
19 1 ▶for (my $i=0;$i < @tval;$i+=3) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @tval) 2 1 3
20 2 my $nip = NetAddr::IP::Lite->new($tval[$i]);
21 ## test scalar return
22 2 my $sclr = $nip->numeric;
23 2 ▶ print "got: $sclr\nexp: $tval[$i+1]\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $sclr . 'x' eq $tval[$i + 1] . 'x' 0 2 2
24 unless $sclr .'x' eq $tval[$i+1] .'x';
25 2 &ok;
26  
27 ## test array return
28 2 my($addr,$mask) = $nip->numeric;
29 2 ▶ print "got: $addr\nexp: $tval[$i+1]\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $addr . 'x' eq $tval[$i + 1] . 'x' 0 2 2
30 unless $addr .'x' eq $tval[$i+1] .'x';
31 2 &ok;
32  
33 2 ▶ print "got: $mask\nexp: $tval[$i+2]\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $mask . 'x' eq $tval[$i + 2] . 'x' 0 2 2
34 unless $mask .'x' eq $tval[$i+2] .'x';
35 2 &ok;
36 }
« Lite/t/v6-cnew.t ↑ Summary Lite/t/broadcast.t »