| 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
| |||||||||||
| 16 | 0 | ▶ | return 0 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | ||||||||||