Branch Coverage

blib/lib/Perinci/Sub/Wrapper.pm
Criterion Covered Total %
branch 198 286 69.2


line true false branch
43 0 182 if ($self->{'_args'}{'core'})
44 0 0 if ($mod =~ /\A(experimental|Scalar::Numeric::Util|Scalar::Util::Numeric::PP)\z/) { }
0 0 elsif ($mod =~ /\A(warnings|List::Util)\z/) { }
53 0 182 if ($self->{'_args'}{'pp'})
54 0 0 if ($mod =~ /\A(List::Util|Scalar::Numeric::Util)\z/) { }
0 0 elsif ($mod =~ /\A(experimental|warnings|Scalar::Util::Numeric::PP)\z/) { }
63 0 182 if ($self->{'_args'}{'core_or_pp'})
64 0 0 if ($mod =~ /\A(Scalar::Numeric::Util)\z/) { }
0 0 elsif ($mod =~ /\A(experimental|warnings|List::Util|Scalar::Util::Numeric::PP)\z/) { }
76 182 48 unless ($mod ~~ $self->{'_modules'})
79 124 58 if ($mod =~ /\A(use|no) (\S+)/) { }
58 0 elsif ($mod =~ /\A\w+(::\w+)*\z/) { }
94 100 0 unless (exists $self->{'_vars'}{$var})
189 98 6 if $self->{'_args'}{'validate_result'}
190 0 6 if $self->_needs_eval
193 0 24 unless $self->section_empty($_)
201 0 1338 unless $ks->{$section}
206 8 358 if ($self->{'_meta'}{'result_naked'}) { }
262 798 1808 unless (exists $self->{'_codes'}{$section})
265 798 0 if $self->_known_sections->{$section}{'order'}
271 0 2606 if ($self->{'_args'}{'debug'})
276 0 0 $self->{'_cur_handler'} ? :
291 2804 1772 if $self->section_empty($s)
292 1094 678 unless &$crit('section', $s)
296 0 4015 if $l->[0] < 0
299 0 4015 if (defined $l->[2])
301 0 0 if $num_ws < 1
387 94 349 if $order > $ks->{'ACCEPT_ARGS'}{'order'} and $order < $ks->{'CALL'}{'order'}
398 106 337 if $order > $ks->{'CALL'}{'order'} and $order < $ks->{'CLOSE_SUB'}{'order'}
429 4 0 if ($v->{'tx'} and $v->{'tx'}{'req'})
466 100 8 if ($v eq 'hash') { }
2 6 elsif ($v eq 'hashref') { }
6 0 elsif ($v =~ /\Aarray(ref)?\z/) { }
467 94 6 if $opt_va
471 2 0 if $opt_va
475 2 4 $1 ? :
476 2 4 if ($ref)
477 2 0 if $opt_va
485 0 12 unless defined $as->{'pos'}
488 0 12 unless $pos >= 0
490 0 12 if ($as->{'slurpy'} // $as->{'greedy'}) { }
491 0 0 if ($ref) { }
497 4 8 if ($ref) { }
510 2 106 if ($value eq 'hashref') { }
4 102 elsif ($value eq 'array') { }
2 100 elsif ($value eq 'arrayref') { }
521 100 8 if ($v eq 'hash') { }
2 6 elsif ($v eq 'hashref') { }
6 0 elsif ($v =~ /\Aarray(ref)?\z/) { }
527 2 4 $1 ? :
528 2 4 $ref ? :
534 0 12 unless defined $as->{'pos'}
537 0 12 unless $pos >= 0
539 0 12 if ($as->{'slurpy'} // $as->{'greedy'}) { }
542 4 8 $ref ? :
573 0 78 unless $v
581 76 2 if ($opt_va)
584 72 4 if $prefix eq ''
599 8 100 if ($argterm =~ /^%\{\s*(.+)\s*\}/) { }
100 0 elsif ($argterm =~ s/^%/\$/) { }
610 78 30 if ($sch) { }
2 28 elsif ($has_default_prop) { }
612 12 66 ref $sch eq 'ARRAY' && exists $sch->[1]{'default'} ? :
613 74 4 if ($opt_va)
618 2 72 if ($argspec->{'stream'})
619 0 2 unless $sch->[0] =~ /\A(str|buf|array)\z/
622 0 2 if $sch->[0] eq 'array' and not $sch->[1]{'of'}
656 2 72 $argspec->{'stream'} ? :
2 72 $argspec->{'stream'} && $sch->[0] eq 'array' ? :
658 0 72 unless $cd->{'v'} == 2
660 72 136 unless $mod_rec->{'phase'} eq 'runtime'
670 2 70 if ($argspec->{'stream'}) { }
680 2 70 if ($argspec->{'meta'})
685 0 2 $prefix ? :
689 2 70 if ($argspec->{'element_meta'})
702 0 2 $prefix ? :
709 2 70 if ($argspec->{'stream'})
715 8 64 if ($has_default_prop) { }
8 56 elsif ($has_sch_default) { }
733 18 88 if ($argspec->{'req'} and $opt_va)
753 0 4 unless $v
779 0 2 unless $cd->{'v'} == 2
781 2 4 unless $mod_rec->{'phase'} eq 'runtime'
803 0 14 unless $v
816 2 16 if $k =~ /\A_/
819 16 0 if $k =~ /\A( summary|description|tags|default_lang| schema|statuses|stream| x )\z/x
827 0 0 unless ($self->can($meth))
832 0 0 unless defined $hm->{'prio'}
835 0 0 unless $hm->{'v'} == $protocol_version
857 4 10 if ($v->{'schema'} and $opt_vr)
860 0 14 if ($v->{'statuses'} and $opt_vr)
863 0 0 if ($sv->{'schema'})
871 12 2 if ($opt_vr)
875 6 6 $v->{'stream'} ? :
884 2 2 if ($v->{'stream'})
885 0 2 unless $sch->[0] =~ /\A(str|buf|array)\z/
888 0 2 if $sch->[0] eq 'array' and not $sch->[1]{'of'}
909 0 4 unless $cd->{'v'} == 2
911 6 10 unless $mod_rec->{'phase'} eq 'runtime'
950 2 2 $sch->[0] eq 'array' ? :
952 0 4 unless $cd->{'v'} == 2
976 0 6 if !!$v == !!$old
979 2 4 if ($v) { }
1007 0 4 if ($value->{'tmp_dir'})
1011 0 4 if ($value->{'trash_dir'})
1015 0 4 if ($value->{'undo_trash_dir'})
1052 0 112 unless $sub or $sub_name
1053 0 112 unless $args{'meta'}
1063 2 108 $wrap_logs->[-1] && $wrap_logs->[-1]{'normalize_schema'} ? :
1075 0 4 if $meta->{'features'} and $meta->{'features'}{'validate_args'}
1080 2 110 if $meta->{'x.perinci.sub.wrapper.disable_validate_args'}
1084 2 110 if grep {$_->{'validate_args'};} @$wrap_logs
1090 2 110 if $meta->{'x.perinci.sub.wrapper.disable_validate_result'}
1094 2 110 if grep {$_->{'validate_result'};} @$wrap_logs
1103 110 2 if (not $sub_name or $sub)
1107 110 0 unless ($sub_name)
1114 112 0 unless ($meta_name)
1125 108 4 unless $opt_sin
1132 2 8 unless exists $meta->{$_}
1145 106 2 if ($args{'log'})
1159 102 6 if ($meta->{'args_as'} =~ /hash/)
1174 2 432 if $k =~ /\A_/
1175 0 432 if $handler_args{$k}
1180 0 432 unless $k =~ /\A\w+\z/
1182 0 432 unless ($self->can($meth))
1185 0 0 unless ($self->can($meth))
1191 218 214 unless defined $hm->{'prio'}
1194 0 214 unless $hm->{'v'} == $protocol_version
1199 10 204 if (exists $opt_cvt->{$k0})
1201 0 10 unless $hm->{'convert'}
1221 98 6 if ($needs_store_res)
1230 98 6 $needs_store_res ? :
102 2 $sn =~ /^\$/ ? :
1231 98 6 if ($args{'validate_result'})
1233 96 2 unless ($meta->{'result_naked'})
1240 0 96 if (log_is_trace()) { }
1260 0 104 if ($use_eval)
1282 98 6 if $needs_store_res
1295 52 52 if ($args{'embed'}) { }
1299 0 52 if ($Log_Wrapper_Code and log_is_trace())
1302 0 0 $ENV{'LINENUM'} // 1 ? :
1307 52 0 if ($args{'compile'})
1309 0 52 if $@ or not $wrapped