TPath/Selector/Id.pm

filter: Statementstmt 68.7% 11 / 16 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 48.1% 13 / 27 CC 2 SCAR 11.6
CC
2
Cov
58%
select
6.0
to_string
2.0
BEGIN
1.0
CRAP 3.2
« TPath/StderrLog.pm ↑ Summary TPath/Test/Node/Match.pm »
1 package TPath::Selector::Id;
2 1 $TPath::Selector::Id::VERSION = '1.007';
3 # ABSTRACT: C<TPath::Selector> that implements C<id(foo)>
4  
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 1 with 'TPath::Selector';
10  
11 1 has id => ( isa => 'Str', is => 'ro', required => 1 );
12  
13 # required by TPath::Selector
14 0 ▶sub select {
Subroutine select: not called CC=2 SCAR=17.9
Pod undocumented
15 0 my ( $self, $ctx ) = @_;
16 0 my $n = $ctx->i->indexed->{ $self->id };
17 0 ▶ $ctx->bud($n) // ();
Condition0%0/3
$ctx->bud($n) // ()
l!l&&r!l&&!r
000
MC/DC0%0/2
$ctx->bud($n) // ()
$ctx->bud($n) ()
Truth table0%0/3
A // B
A= $ctx->bud($n)B= ()
ABresult
1X1
011
000
18 }
19  
20 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
21 0 my $self = shift;
22 0 return ':id(' . $self->_escape( $self->id, ')' ) . ')';
23 }
24  
25 1 __PACKAGE__->meta->make_immutable;
26  
27 1 1;
28  
29 __END__
« TPath/StderrLog.pm ↑ Summary TPath/Test/Node/Match.pm »