TPath/Test/One.pm

filter: Statementstmt 23.0% 3 / 13 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod n/a totaltotal 20.0% 4 / 20 CC 4 SCAR 26.3
CC
4
Cov
18%
test
20.0
to_string
2.0
BEGIN
1.0
CRAP 13.8
« TPath/Stringifiable.pm ↑ Summary TPath/Attributes/Standard.pm »
1 package TPath::Test::One;
2 $TPath::Test::One::VERSION = '1.007';
3 # ABSTRACT: implements logical function of tests which returns true iff only one test is true
4  
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 with 'TPath::Test::Compound';
9  
10 # required by TPath::Test
11 0 ▶sub test {
Subroutine test: not called CC=4 SCAR=30.0
12 0 my ( $self, $ctx ) = @_;
13 0 my $count = 0;
14 0 for my $t ( @{ $self->tests } ) {
15 0 ▶ if ( $t->test($ctx) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($t->test($ctx)) 0 0 0
16 0 ▶ return 0 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 0 0 0
17 0 $count++;
18 }
19 }
20 0 return $count;
21 }
22  
23 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
24 0 my $self = shift;
25 0 return $self->_compound_to_string(';');
26 }
27  
28 __PACKAGE__->meta->make_immutable;
29  
30 1;
31  
32 __END__
« TPath/Stringifiable.pm ↑ Summary TPath/Attributes/Standard.pm »