Branch Coverage

blib/lib/Pod/Simple/BlackBox.pm
Criterion Covered Total %
branch 398 568 70.0


line true false branch
38 0 642 do { no integer; $] <= 5.006002 } ? :
42 0 642 if $@
46 0 642 if $@
49 642 0 if $matches
57 70 0 unless defined &Pod::Simple::BlackBox::DEBUG
147 0 19202 if ($self->{'source_dead'})
152 911 18291 unless (defined $source_line)
164 17384 907 if ($self->{'line_count'}++) { }
172 0 907 if (($line = $source_line) =~ s/^$utf8_bom//s) { }
0 907 elsif ($line =~ s/^\xFE\xFF//s) { }
0 907 elsif ($line =~ s/^\xFF\xFE//s) { }
208 21 16376 if (not $self->{'parse_characters'} || $self->{'encoding'} and $self->{'in_pod'} || $line =~ /^=/s and $line =~ /$non_ascii_re/)
269 0 21 if do { no integer; "$]" < "5.006" }
275 21 0 if (do { no integer; "$]" >= 5.007003 }) { }
281 15 6 unless utf8::decode($copy)
305 0 0 unless ($byte =~ /$non_ascii_re/)
326 0 0 if ($b_ord < 194) { }
0 0 elsif ($b_ord <= 223) { }
0 0 elsif ($b_ord <= 239) { }
0 0 elsif ($b_ord <= 244) { }
334 0 0 if $b_ord == 224
339 0 0 if $b_ord == 240
349 0 0 if $i + $needed >= length $line
356 0 0 if $b_ord < $min_cont or $b_ord > 191
384 0 6 if $line =~ /[\x81\x8D\x8F\x90\x9D]/
387 0 6 if $copy =~ /[\x80-\x9F]/
390 0 6 if $copy =~ /$cs_re/
391 0 6 if $cs_re and $copy =~ /$cs_re/
392 0 6 if $cn_re and $copy =~ /$cn_re/
393 0 6 if $cn_re and $copy =~ /$cn_re/
394 0 6 if $copy =~ /$deprecated_re/
395 0 6 if $copy =~ /$deprecated_re/
401 1 5 if $copy =~ /$rare_blocks_re/
402 1 5 if $rare_blocks_re and $copy =~ /$rare_blocks_re/
407 0 5 if $later_latin_re and $copy =~ /$later_latin_re/
408 0 5 if $later_latin_re and $copy =~ /$later_latin_re/
417 5 0 if ($script_run_re)
418 4 1 if $copy =~ /$script_run_re/
429 0 0 unless $copy =~ /$latin_re/
430 0 0 unless $copy =~ /$latin_re/
432 0 0 if $copy =~ /$every_char_is_latin_re/
433 0 0 if $copy =~ /$every_char_is_latin_re/
449 21 0 if $self->{'_transcoder'}
461 1723 16568 unless ($self->{'in_pod'})
462 962 761 if ($line =~ /^=([a-zA-Z][a-zA-Z0-9]*)(?:\s|$)/s) { }
463 4 958 if ($1 eq 'cut') { }
483 18 743 if $code_handler
491 0 761 if ($line =~ /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/)
507 1821 15705 if $self->{'_transcoder'}
510 47 17479 if ($line =~ /^=encoding\s+\S+\s*$/s)
511 1 46 if $self->parse_characters
515 170 17355 if ($line =~ /^=cut/s) { }
5803 11552 elsif ($line =~ /^(\s*)$/s) { }
6415 5137 elsif ($self->{'last_was_blank'}) { }
523 7 163 if $cut_handler
530 22 5781 if (defined $1 and $1 =~ /[^\S\r\n]/)
531 9 13 if $wl_handler
535 632 5170 if (not $self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq "~Verbatim")
540 5708 94 unless ($self->{'start_of_pod_block'} or $self->{'last_was_blank'})
548 2907 3508 if ($line =~ /^(=[a-zA-Z][a-zA-Z0-9]*)(\s+|$)(.*)/s) { }
717 2791 elsif ($line =~ /^\s/s) { }
551 33 2874 if $2 and $2 ne " "
565 173 544 if (not $self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq '~Verbatim') { }
586 5137 0 if (@$paras) { }
607 8352 20 unless $self->{'heading_filter'}
611 10 10 if ($element_name =~ /\Ahead(\d)\z/)
620 10 10 if (my $head = $self->{'_in_head'})
626 8 2 unless $self->{'_filter_allowed'}
634 8352 20 unless $self->{'heading_filter'}
638 10 10 if (my $head = $self->{'_in_head'})
639 0 10 if ($element_name ne $head->{'element'})
651 2 8 if ($allowed)
660 16 4 unless $self->{'_filter_allowed'}
668 9997 20 unless $self->{'heading_filter'}
672 10 10 if (my $head = $self->{'_in_head'})
679 8 2 unless $self->{'_filter_allowed'}
689 0 10 unless my $filter = $self->{'heading_filter'}
695 2 12 unless defined $heading
698 8 6 unless $heading =~ /$regex/
711 0 2 if (@selections and $selections[0] eq '+') { }
722 0 2 unless (eval { do { push @$filter, $self->_compile_heading_spec($spec); 1 } })
738 0 4 unless length $part
742 0 4 $negate ? :
744 0 4 unless (eval { do { $part = $negate ? qr/^(?!$part$)/ : qr/^$part$/; 1 } })
749 0 2 if @bad
759 0 67 if $self->parse_characters
763 0 67 unless $line =~ /^=encoding\s+(\S+)\s*$/s
776 5 62 if ($self->{'encoding'}) { }
0 62 elsif (do { '???'; $self->{'encoding'} = $e; 1 } and $e eq 'HACKRAW') { }
60 2 elsif ('Pod::Simple::Transcode'->encoding_is_available($e)) { }
783 3 2 if ($norm_current eq $norm_e) { }
806 0 60 if $self->{'_transcoder'}
813 0 60 if $@
833 248 0 unless $n eq $norm
847 1 66 if (defined $self->{'_processed_encoding'})
869 45 1 if (defined $self->{'_processed_encoding'}) { }
875 0 45 if (not $self->{'encoding_command_statuses'}) { }
4 41 elsif ($self->{'encoding_command_statuses'}[-1]) { }
907 871 40 unless $self->{'errata'} and keys %{$$self{"errata"};}
982 955 6368 unless @{$paras = $self->{'paras'};}
990 925 5443 unless ($self->{'doc_has_started'})
1009 31 894 $starting_contentless ? :
1019 4350 4741 if $paras->[0][0] =~ /^=/
1024 1349 51 if @$paras == 1 and $paras->[0][0] eq '=over' || $paras->[0][0] eq '=item' || $paras->[0][0] eq '~Verbatim' && $self->{'in_pod'}
1053 50 7511 if ($para_type eq '=for') { }
127 7384 elsif ($para_type eq '=begin') { }
130 7254 elsif ($para_type eq '=end') { }
961 6293 elsif ($para_type eq '~end') { }
1054 50 0 if $self->_ponder_for($para, $curr_open, $paras)
1057 127 0 if $self->_ponder_begin($para, $curr_open, $paras)
1060 130 0 if $self->_ponder_end($para, $curr_open, $paras)
1063 961 0 if $self->_ponder_doc_end($para, $curr_open, $paras)
1069 42 6251 if (grep $_->[1]{'~ignore'}, @$curr_open)
1077 582 5669 if ($para_type eq '=pod') { }
221 5448 elsif ($para_type eq '=over') { }
217 5231 elsif ($para_type eq '=back') { }
1081 4 217 if $self->_ponder_over($para, $curr_open, $paras)
1084 10 207 if $self->_ponder_back($para, $curr_open, $paras)
1099 6 754 if ($para_type =~ /^=head\d$/s and not $self->{'accept_heads_anywhere'} and @$curr_open and $curr_open->[-1][0] eq "=over")
1114 1029 4196 if ($para_type eq '=item') { }
21 4175 elsif ($para_type eq '=extend') { }
46 4129 elsif ($para_type eq '=encoding') { }
538 3591 elsif ($para_type eq '~Verbatim') { }
2794 797 elsif ($para_type eq '~Para') { }
30 767 elsif ($para_type eq 'Data') { }
755 12 elsif ($para_type =~ s/^=//s and defined($para_type = $self->{'accept_directives'}{$para_type})) { }
1117 0 1029 unless (@$curr_open and $over = (grep {$_->[0] eq "=over";} @$curr_open)[-1])
1133 0 1029 if (not $over_type) { }
0 1029 elsif ($over_type eq 'block') { }
842 187 elsif ($over_type eq 'text') { }
28 159 elsif ($over_type eq 'number') { }
159 0 elsif ($over_type eq 'bullet') { }
1139 0 0 unless ($curr_open->[-1][1]{'~bitched_about'})
1158 838 4 if ($item_type eq 'text') { }
4 0 elsif ($item_type eq 'number' or $item_type eq 'bullet') { }
1183 0 28 if ($item_type eq 'bullet') { }
0 28 elsif ($item_type eq 'text') { }
0 28 elsif ($item_type ne 'number') { }
28 0 elsif ($expected_value == $para->[1]{'number'}) { }
1219 28 0 if (@$para == 2)
1221 25 3 if ($paras->[0][0] eq '~Para') { }
1236 159 0 if ($item_type eq 'bullet') { }
0 0 elsif ($item_type eq 'number') { }
0 0 elsif ($item_type eq 'text') { }
1239 101 58 if ($para->[1]{'~_freaky_para_hack'})
1265 58 101 if (@$para == 2)
1267 58 0 if ($paras->[0][0] eq '~Para') { }
1293 11 35 unless $self->keep_encoding_directive
1323 3362 1819 if ($para_type =~ s/^\?//s)
1324 2087 1275 if (not @$curr_open) { }
1331 1151 124 if (not @fors) { }
73 51 elsif ($fors[-1][1]{'~resolve'}) { }
1339 18 55 if ($para_type eq 'Data') { }
1354 4593 588 if ($para_type eq 'Plain') { }
534 54 elsif ($para_type eq 'Verbatim') { }
54 0 elsif ($para_type eq 'Data') { }
1372 4975 206 if $seen_legal_directive and not $self->{'~tried_gen_errata'}
1391 0 50 if (grep $_->[1]{'~ignore'}, @$curr_open)
1397 50 0 if ($para->[$i] =~ s/^\s*(\S+)\s*//s)
1402 0 50 unless (defined $target)
1434 0 127 unless (length $content)
1444 2 125 if $title
1450 33 94 if $content =~ s/^!//s
1452 52 75 if $content =~ s/^://s
1456 33 94 $neg ? :
1462 183 66 unless $self->{'accept_targets'}{$target_name}
1467 18 48 if $self->{'accept_targets'}{$target_name} eq "force_resolve"
1473 33 94 if ($neg)
1474 6 27 if ($dont_ignore) { }
1497 40 87 if (not $dont_ignore or scalar grep($_->[1]{'~ignore'}, @$curr_open)) { }
1500 87 0 unless $self->{'~tried_gen_errata'}
1514 0 130 unless (length $content)
1519 0 0 @$curr_open && $curr_open->[-1][0] eq '=for' ? :
1527 0 130 unless ($content =~ /^\S+$/)
1537 0 130 unless (@$curr_open and $curr_open->[-1][0] eq "=for")
1547 3 127 unless ($content eq $curr_open->[-1][1]{'target'})
1560 40 87 if (grep $_->[1]{'~ignore'}, @$curr_open) { }
1568 87 0 unless $self->{'~tried_gen_errata'}
1579 10 951 if (@$curr_open) { }
1598 911 40 unless ($self->{'~tried_gen_errata'})
1601 40 871 if (@extras)
1618 0 582 if @$para > 3
1624 6 576 if (my $pod_handler = $self->{'pod_handler'})
1626 3 3 $line eq '' ? :
1639 0 221 unless @$paras
1642 192 29 if ($paras->[0][0] eq '=item') { }
6 23 elsif ($paras->[0][0] eq '=back') { }
0 23 elsif ($paras->[0][0] eq '~end') { }
1647 2 4 if ($self->{'parse_empty_lists'}) { }
1669 120 97 if ($content =~ /^\s*$/s) { }
97 0 elsif ($content =~ /^\s*((?:\d*\.)?\d+)\s*$/s) { }
1674 0 97 if ($1 == 0)
1690 177 40 unless $self->{'~tried_gen_errata'}
1701 0 217 if ($content =~ /\S/)
1708 217 0 if (@$curr_open and $curr_open->[-1][0] eq '=over') { }
1712 177 40 unless $self->{'~tried_gen_errata'}
1730 0 0 unless (@$curr_open and $over = (grep {$_->[0] eq "=over";} @$curr_open)[-1])
1746 0 0 if (not $over_type) { }
0 0 elsif ($over_type eq 'block') { }
0 0 elsif ($over_type eq 'text') { }
0 0 elsif ($over_type eq 'number') { }
0 0 elsif ($over_type eq 'bullet') { }
1752 0 0 unless ($curr_open->[-1][1]{'~bitched_about'})
1771 0 0 if ($item_type eq 'text') { }
0 0 elsif ($item_type eq 'number' or $item_type eq 'bullet') { }
1796 0 0 if ($item_type eq 'bullet') { }
0 0 elsif ($item_type eq 'text') { }
0 0 elsif ($item_type ne 'number') { }
0 0 elsif ($expected_value == $para->[1]{'number'}) { }
1832 0 0 if (@$para == 2)
1834 0 0 if ($paras->[0][0] eq '~Para') { }
1849 0 0 if ($item_type eq 'bullet') { }
0 0 elsif ($item_type eq 'number') { }
0 0 elsif ($item_type eq 'text') { }
1852 0 0 if ($para->[1]{'~_freaky_para_hack'})
1878 0 0 if (@$para == 2)
1880 0 0 if ($paras->[0][0] eq '~Para') { }
1901 4488 102 unless (@$para == 2 or @$para == 3 and $para->[2] eq "" or $para->[1]{'~cooked'})
1921 453 81 unless ($self->{'_output_is_for_JustPod'})
1926 2 451 if not defined $tab_width or $tab_width =~ /\D/
1931 10 443 if ($indent and ref $indent eq "CODE")
1940 32 2045 if $indent
1941 1 2076 unless $tab_width
1961 103 431 if ($self->{'accept_codes'} and $self->{'accept_codes'}{'VerbatimFormatted'}) { }
2 429 elsif ($self->{'codes_in_verbatim'}) { }
1975 395 34 if @$para > 3
1985 15 39 if @$para > 3
2002 2893 10017 if (ref $x) { }
2019 0 10 unless $self->{'curr_open'}
2023 9 6 if ($copy[0] eq '=for') { }
6 0 elsif ($copy[0] eq '=over') { }
2036 15 0 unless (@copy > 2)
2038 6 9 unless defined $copy[-1]
2080 11 444 if ($p->[$i] =~ m[^#:([ \^\/\%]*)\n?$]s) { }
2084 1 10 if ($$p[$i - 1] =~ m[^#:[ \^\/\%]*\n?$]s) { }
2106 0 10 unless (length $formatting and $$p[$i - 1] =~ /\S/)
2112 3 7 if (length $formatting >= length $$p[$i - 1]) { }
2127 32 22 if ($2) { }
2133 2 0 $5 ? :
10 2 $4 ? :
10 12 $3 ? :
2159 0 0 unless (ref $p->[$i] or ref $$p[$i + 1])
2169 103 0 unless (ref $p->[$i])
2170 103 0 if ($p->[$i] =~ s/\n$//s) { }
2208 3613 875 unless ($preserve_space or $self->{'preserve_whitespace'})
2295 3090 12874 if (defined $1) { }
133 12741 elsif (defined $4) { }
3064 9677 elsif (defined $5) { }
9677 0 elsif (defined $6) { }
2298 122 2968 if (defined $2) { }
2309 440 2650 if ('L' eq $code) { }
2310 1 439 if ($inL) { }
2322 190 2460 if $inL
2332 18 3072 if ($self->{'_output_is_for_JustPod'} and $bracket_count > 1)
2335 3 15 if $lspacer ne " "
2341 1 132 if (not @stack) { }
3 129 elsif (not $stack[-1]) { }
122 7 elsif ($stack[-1] == length $4) { }
0 7 elsif ($stack[-1] < length $4) { }
2366 3 0 if ($3 ne " " and $self->{'_output_is_for_JustPod'})
2367 1 2 if ($3 ne '') { }
1 1 elsif ($lineage[-1][1]{'~lspacer'} eq ' ') { }
2382 2 123 if 2 == @{$lineage[-1];}
2385 29 96 if ($inL == @stack)
2393 20 105 if $inL
2398 2957 107 if (@stack and not $stack[-1]) { }
2402 0 2957 if (length $5 == 2) { }
41 2916 elsif (2 == @{$lineage[-1];}) { }
2408 410 2547 if ($inL == @stack)
2420 172 2892 if $inL
2425 761 8916 if $inL
2437 8 4482 if (@stack)
2440 0 8 if 2 == @{$lineage[-1];}
2445 0 8 if ($ender_length) { }
2476 388 3680 if (ref($lol->[$i] || '') and UNIVERSAL::isa($lol->[$i], 'ARRAY')) { }
2490 0 3 unless @$curr_open
2495 4 0 if ($_->[0] eq '=for') { }
2529 0 592 if (not defined $_) { }
58 534 elsif (ref $_ eq 'ARRAY' or ref $_ eq 'Pod::Simple::LinkSection') { }
0 534 elsif (ref $_ eq 'SCALAR') { }
48 486 elsif (ref $_ eq 'HASH') { }
2 484 elsif (not length $_) { }
26 458 elsif ($_ eq '0' or /^-?(?:[123456789]\d*|0)(?:\.\d+)?$/s and $_ ne '-0') { }
2560 0 0 unless $pretty_form{$1}