Lite/t/firstlast.t

filter: Statementstmt 100% 46 / 46 Branchbran 50.0% 8 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 87.6% 57 / 65 CC 1 SCAR 0.0
CC
1
Cov
87%
BEGIN
1.0
BEGIN
1.0
ok
1.0
CRAP 1.0
« Lite/t/over_math.t ↑ Summary Lite/t/v4-new-first.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..8\n";
8  
9 1 my $test = 1;
10 8 ▶sub ok() {
Subroutine ok: called CC=1 SCAR=0.0
11 8 print 'ok ',$test++,"\n";
12 }
13  
14 1 my $ip4 = NetAddr::IP::Lite->new('1.2.3.11/29');
15 1 my $ip6 = NetAddr::IP::Lite->new('FF::8B/125');
16  
17 1 my $exp = '1.2.3.9';
18 1 my $rv = $ip4->first->addr;
19 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
20 unless $rv eq $exp;
21 1 &ok;
22  
23 1 $exp = '1.2.3.14';
24 1 $rv = $ip4->last->addr;
25 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
26 unless $rv eq $exp;
27 1 &ok;
28  
29 1 $exp = 'FF:0:0:0:0:0:0:89';
30 1 $rv = $ip6->first->addr;
31 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
32 unless $rv eq $exp;
33 1 &ok;
34  
35 1 $exp = 'FF:0:0:0:0:0:0:8E';
36 1 $rv = $ip6->last->addr;
37 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
38 unless $rv eq $exp;
39 1 &ok;
40  
41 1 $ip4 = NetAddr::IP::Lite->new('1.2.3.11/31');
42 1 $ip6 = NetAddr::IP::Lite->new('FF::8B/127');
43  
44 1 $exp = '1.2.3.10';
45 1 $rv = $ip4->first->addr;
46 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
47 unless $rv eq $exp;
48 1 &ok;
49  
50 1 $exp = '1.2.3.11';
51 1 $rv = $ip4->last->addr;
52 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
53 unless $rv eq $exp;
54 1 &ok;
55  
56 1 $exp = 'FF:0:0:0:0:0:0:8A';
57 1 $rv = $ip6->first->addr;
58 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
59 unless $rv eq $exp;
60 1 &ok;
61  
62 1 $exp = 'FF:0:0:0:0:0:0:8B';
63 1 $rv = $ip6->last->addr;
64 1 ▶print "got: $rv, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $rv eq $exp 0 1 1
65 unless $rv eq $exp;
66 1 &ok;
« Lite/t/over_math.t ↑ Summary Lite/t/v4-new-first.t »