blib/lib/Linux/Event/IO/Sock/Listener.pm

filter: Statementstmt 100% 22 / 22 Branchbran 62.5% 5 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 80.9% 34 / 42 CC 6 SCAR 14.4
CC
6
Cov
85%
new
6.9
BEGIN
1.0
BEGIN
1.0
CRAP 4.2
« bench/run-stream-watcher-state-bench.pl ↑ Summary bench/run-resolver-microbench.pl »
1 package Linux::Event::IO::Sock::Listener;
2 25 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 25 our $VERSION = '0.119';
7  
8 25 ▶use parent 'Linux::Event::_Socket::Listener';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 25 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 50 ▶sub new ($class, %option) {
Subroutine new: called CC=6 SCAR=19.3
Pod undocumented
12 50 ▶ if (exists $option{stream}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $option{"stream"}) 50 0 50
13 croak 'new(): stream must be a hash reference'
14 50 ▶ if ref($option{stream}) ne 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if ref $option{"stream"} ne "HASH" 0 50 50
15 50 ▶ if (exists $option{stream}{class}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $option{"stream"}{"class"}) 48 2 50
16 48 my $stream_class = $option{stream}{class};
17 48 ▶ croak 'new(): stream class must name a Linux::Event::IO::Sock::Stream subclass'
Branch: 1 branch
BranchTrueFalseTotal
if ref $stream_class or not $stream_class->isa("Linux::Event::IO::Sock::Stream") 0 48 48
Condition33%1/3
ref $stream_class or not $stream_class->isa("Linux::Event::IO::Sock::Stream")
l!l&&r!l&&!r
0048
MC/DC0%0/2
ref $stream_class or not $stream_class->isa("Linux::Event::IO::Sock::Stream")
ref $stream_class not $stream_class->isa("Linux::Event::IO::Sock::Stream")
Truth table33%1/3
A or not(B)
A= ref $stream_classB= not $stream_class->isa("Linux::Event::IO::Sock::Stream")
ABresult
1X1
011
000
18 if ref($stream_class)
19 || !$stream_class->isa('Linux::Event::IO::Sock::Stream');
20 }
21 }
22 50 return $class->SUPER::new(%option);
23 }
24  
25 25 1;
26  
27 __END__
« bench/run-stream-watcher-state-bench.pl ↑ Summary bench/run-resolver-microbench.pl »