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 19136 if ($self->{'source_dead'})
152 903 18233 unless (defined $source_line)
164 17334 899 if ($self->{'line_count'}++) { }
172 0 899 if (($line = $source_line) =~ s/^$utf8_bom//s) { }
0 899 elsif ($line =~ s/^\xFE\xFF//s) { }
0 899 elsif ($line =~ s/^\xFF\xFE//s) { }
208 21 16364 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 1713 16520 unless ($self->{'in_pod'})
462 954 759 if ($line =~ /^=([a-zA-Z][a-zA-Z0-9]*)(?:\s|$)/s) { }
463 4 950 if ($1 eq 'cut') { }
483 18 741 if $code_handler
491 0 759 if ($line =~ /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/)
507 1777 15693 if $self->{'_transcoder'}
510 39 17431 if ($line =~ /^=encoding\s+\S+\s*$/s)
511 1 38 if $self->parse_characters
515 168 17301 if ($line =~ /^=cut/s) { }
5776 11525 elsif ($line =~ /^(\s*)$/s) { }
6388 5137 elsif ($self->{'last_was_blank'}) { }
523 7 161 if $cut_handler
530 22 5754 if (defined $1 and $1 =~ /[^\S\r\n]/)
531 9 13 if $wl_handler
535 632 5143 if (not $self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq "~Verbatim")
540 5681 94 unless ($self->{'start_of_pod_block'} or $self->{'last_was_blank'})
548 2885 3503 if ($line =~ /^(=[a-zA-Z][a-zA-Z0-9]*)(\s+|$)(.*)/s) { }
717 2786 elsif ($line =~ /^\s/s) { }
551 33 2852 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 8335 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 8335 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 9986 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 59 if $self->parse_characters
763 0 59 unless $line =~ /^=encoding\s+(\S+)\s*$/s
776 5 54 if ($self->{'encoding'}) { }
0 54 elsif (do { '???'; $self->{'encoding'} = $e; 1 } and $e eq 'HACKRAW') { }
52 2 elsif ('Pod::Simple::Transcode'->encoding_is_available($e)) { }
783 3 2 if ($norm_current eq $norm_e) { }
806 0 52 if $self->{'_transcoder'}
813 0 52 if $@
833 248 0 unless $n eq $norm
847 1 58 if (defined $self->{'_processed_encoding'})
869 37 1 if (defined $self->{'_processed_encoding'}) { }
875 0 37 if (not $self->{'encoding_command_statuses'}) { }
4 33 elsif ($self->{'encoding_command_statuses'}[-1]) { }
907 863 40 unless $self->{'errata'} and keys %{$$self{"errata"};}
982 947 6339 unless @{$paras = $self->{'paras'};}
990 917 5422 unless ($self->{'doc_has_started'})
1009 31 886 $starting_contentless ? :
1019 4322 4728 if $paras->[0][0] =~ /^=/
1024 1346 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 7476 if ($para_type eq '=for') { }
127 7349 elsif ($para_type eq '=begin') { }
130 7219 elsif ($para_type eq '=end') { }
953 6266 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 953 0 if $self->_ponder_doc_end($para, $curr_open, $paras)
1069 42 6224 if (grep $_->[1]{'~ignore'}, @$curr_open)
1077 580 5644 if ($para_type eq '=pod') { }
218 5426 elsif ($para_type eq '=over') { }
214 5212 elsif ($para_type eq '=back') { }
1081 4 214 if $self->_ponder_over($para, $curr_open, $paras)
1084 10 204 if $self->_ponder_back($para, $curr_open, $paras)
1099 6 751 if ($para_type =~ /^=head\d$/s and not $self->{'accept_heads_anywhere'} and @$curr_open and $curr_open->[-1][0] eq "=over")
1114 1026 4180 if ($para_type eq '=item') { }
21 4159 elsif ($para_type eq '=extend') { }
38 4121 elsif ($para_type eq '=encoding') { }
538 3583 elsif ($para_type eq '~Verbatim') { }
2789 794 elsif ($para_type eq '~Para') { }
30 764 elsif ($para_type eq 'Data') { }
752 12 elsif ($para_type =~ s/^=//s and defined($para_type = $self->{'accept_directives'}{$para_type})) { }
1117 0 1026 unless (@$curr_open and $over = (grep {$_->[0] eq "=over";} @$curr_open)[-1])
1133 0 1026 if (not $over_type) { }
0 1026 elsif ($over_type eq 'block') { }
839 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 835 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 3 35 unless $self->keep_encoding_directive
1323 3357 1813 if ($para_type =~ s/^\?//s)
1324 2082 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 4582 588 if ($para_type eq 'Plain') { }
534 54 elsif ($para_type eq 'Verbatim') { }
54 0 elsif ($para_type eq 'Data') { }
1372 4964 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 943 if (@$curr_open) { }
1598 903 40 unless ($self->{'~tried_gen_errata'})
1601 40 863 if (@extras)
1618 0 580 if @$para > 3
1624 6 574 if (my $pod_handler = $self->{'pod_handler'})
1626 3 3 $line eq '' ? :
1639 0 218 unless @$paras
1642 189 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 94 if ($content =~ /^\s*$/s) { }
94 0 elsif ($content =~ /^\s*((?:\d*\.)?\d+)\s*$/s) { }
1674 0 94 if ($1 == 0)
1690 174 40 unless $self->{'~tried_gen_errata'}
1701 0 214 if ($content =~ /\S/)
1708 214 0 if (@$curr_open and $curr_open->[-1][0] eq '=over') { }
1712 174 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 4477 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 2890 10006 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 3602 875 unless ($preserve_space or $self->{'preserve_whitespace'})
2295 3087 12860 if (defined $1) { }
130 12730 elsif (defined $4) { }
3064 9666 elsif (defined $5) { }
9666 0 elsif (defined $6) { }
2298 119 2968 if (defined $2) { }
2309 437 2650 if ('L' eq $code) { }
2310 1 436 if ($inL) { }
2322 190 2460 if $inL
2332 18 3069 if ($self->{'_output_is_for_JustPod'} and $bracket_count > 1)
2335 3 15 if $lspacer ne " "
2341 1 129 if (not @stack) { }
3 126 elsif (not $stack[-1]) { }
119 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 120 if 2 == @{$lineage[-1];}
2385 26 96 if ($inL == @stack)
2393 20 102 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 758 8908 if $inL
2437 8 4471 if (@stack)
2440 0 8 if 2 == @{$lineage[-1];}
2445 0 8 if ($ender_length) { }
2476 388 3661 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}