TPath/TypeCheck.pm

filter: Statementstmt 66.6% 6 / 9 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod n/a totaltotal 46.6% 7 / 15 CC 3 SCAR 22.2
CC
3
Cov
46%
_typecheck
12.0
BEGIN
1.0
CRAP 9.2
« TPath/Attributes/Standard.pm ↑ Summary TPath/Test/And.pm »
1 package TPath::TypeCheck;
2 2 $TPath::TypeCheck::VERSION = '1.007';
3 # ABSTRACT: applies type constraint on nodes
4  
5  
6 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 2 has node_type =>
10 ( isa => 'Maybe[Str]', is => 'ro', writer => '_node_type', default => undef );
11  
12  
13 0 ▶sub _typecheck {
Subroutine _typecheck: not called CC=3 SCAR=24.8
14 0 my ( $self, $n ) = @_;
15 0 ▶ return unless $self->node_type;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->node_type 0 0 0
16 0 ▶ confess 'can only handle nodes of type ' . $self->node_type
Branch: 1 branch
BranchTrueFalseTotal
unless $n->isa($self->node_type) 0 0 0
17 unless $n->isa( $self->node_type );
18 }
19  
20 2 1;
21  
22 __END__
« TPath/Attributes/Standard.pm ↑ Summary TPath/Test/And.pm »