Branch Coverage

blib/lib/Pod/Usage.pm
Criterion Covered Total %
branch 105 148 70.9


line true false branch
28 0 28 if $@
44 19 7 if (@_ > 0) { }
1 6 elsif (not defined $_) { }
3 3 elsif (ref $_) { }
2 1 elsif (/^[-+]?\d+$/) { }
54 3 0 if ref $_ eq "HASH"
62 1 0 if $_
72 0 75 if $key =~ /^-msg/i
73 21 54 if $key =~ /^-exit/i
78 2 24 if (not defined $opts{'-exitval'} || defined $opts{'-verbose'}) { }
3 21 elsif (not defined $opts{'-exitval'}) { }
2 19 elsif (not defined $opts{'-verbose'}) { }
83 3 0 $opts{'-verbose'} > 0 ? :
93 19 6 lc $opts{'-exitval'} eq 'noexit' || $opts{'-exitval'} < 2 ? :
25 1 unless defined $opts{'-output'}
95 14 12 unless defined $opts{'-input'}
98 1 25 unless (ref $opts{'-input'} or -e $opts{'-input'})
100 0 1 $^O eq 'MacOS' || $^O eq 'VMS' ? :
0 1 $^O =~ /^(?:dos|os2|MSWin32)$/i ? :
104 1 0 ref $pathspec ? :
106 1 0 length $dirname ? :
107 1 0 if -e $_ and $opts{'-input'} = $_
113 7 19 if ($opts{'-verbose'} == 0) { }
4 15 elsif ($opts{'-verbose'} == 1) { }
4 11 elsif ($opts{'-verbose'} >= 2 and $opts{'-verbose'} != 99) { }
11 0 elsif ($opts{'-verbose'} == 99) { }
127 3 8 ref $sections ? :
134 0 26 $opts{'-perldoc'} ? :
137 0 26 if ($Pod::Usage::Config{'versiononly'} and $Pod::Usage::Config{'startperl'} =~ /\Q$version\E$/)
140 0 26 unless -e $progpath
143 2 24 if (not $opts{'-noperldoc'} and $opts{'-verbose'} >= 2 and not ref $opts{'-input'} and $opts{'-output'} == \*STDOUT) { }
149 1 1 if $opts{'-message'}
150 2 0 if (defined $opts{'-input'} and $opts{'-input'} =~ /^\s*(\S.*?)\s*$/) { }
155 1 1 if ($opts{'-perldocopt'})
160 0 2 if $opts{'-perlcmd'}
163 0 2 if ($?)
166 0 0 if (defined $pager and length $pager) { }
167 0 0 $^O =~ /win/i ? :
182 24 1 unless lc $opts{'-exitval'} eq "noexit"
197 2 24 if ($self->can('initialize')) { }
204 0 240 if defined $val
229 61 53 unless defined $regexs[$i] and length $regexs[$i]
235 0 114 if $_ eq "!"
240 1 113 if ($@) { }
246 113 0 unless /^\^/
247 113 0 unless /\$$/
248 3 110 if $negated
251 37 1 !$bad_regexs ? :
256 0 26 if ($ISA[0]->can('select')) { }
260 0 26 $sections[0] eq '+' ? :
262 0 26 unless (@sections)
263 0 0 unless $add
267 26 0 unless $add and $self->{'USAGE_SELECT'}
272 37 1 if (defined $cs) { }
289 0 31 if $self->isa("Pod::Text::Termcap")
298 91 621 if ($element eq 'head1') { }
52 569 elsif ($element =~ /^head(\d+)$/ and $1) { }
300 84 7 if ($self->{'USAGE_OPTIONS'}{'-verbose'} < 2)
305 0 52 unless $self->{'USAGE_HEADINGS'}
310 143 569 if ($element =~ /^head\d+$/)
312 0 143 if (not $self->{'USAGE_SELECT'} && @{$self->{'USAGE_SELECT'};}) { }
319 78 230 unless defined $headings[$i]
322 6 302 $negated ? :
324 166 142 unless $match
326 40 166 if ($match)
335 136 7 if ($self->{'USAGE_OPTIONS'}{'-verbose'} < 2)
337 72 6 length $2 > 2 ? :
338 136 0 unless /:\s*$/
343 330 382 if ($self->{'USAGE_SKIPPING'} and not $element =~ /^over-|^[BCFILSZ]$/) { }
354 21 2 unless my $msg = $self->{'USAGE_OPTIONS'}{'-message'}
363 0 0 unless my $msg = $self->{'USAGE_OPTIONS'}{'-message'}
373 0 0 if ($self->{'USAGE_OPTIONS'}{'-verbose'} < 2 and /^=head/)
377 0 0 length $2 > 2 ? :
379 0 0 unless /:\s*$/