Branch Coverage

blib/lib/Pod/Simple/BlackBox.pm
Criterion Covered Total %
branch 368 526 69.9


line true false branch
38 0 624 $] le 5.006002 ? :
42 0 624 if $@
46 0 624 if $@
49 624 0 if $matches
57 68 0 unless defined &Pod::Simple::BlackBox::DEBUG
147 0 19029 if ($self->{'source_dead'})
152 890 18139 unless (defined $source_line)
164 17253 886 if ($self->{'line_count'}++) { }
172 0 886 if (($line = $source_line) =~ s/^$utf8_bom//s) { }
0 886 elsif ($line =~ s/^\xFE\xFF//s) { }
0 886 elsif ($line =~ s/^\xFF\xFE//s) { }
208 21 16270 if (not $self->{'parse_characters'} || $self->{'encoding'} and $self->{'in_pod'} || $line =~ /^=/s and $line =~ /$non_ascii_re/)
269 0 21 if $] lt "5.006"
275 21 0 if ($] ge 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 0 5 if ($script_run_re)
418 0 0 if $copy =~ /$script_run_re/
429 0 5 unless $copy =~ /$latin_re/
430 0 5 unless $copy =~ /$latin_re/
432 4 1 if $copy =~ /$every_char_is_latin_re/
433 4 1 if $copy =~ /$every_char_is_latin_re/
449 21 0 if $self->{'_transcoder'}
461 1700 16439 unless ($self->{'in_pod'})
462 941 759 if ($line =~ /^=([a-zA-Z][a-zA-Z0-9]*)(?:\s|$)/s) { }
463 4 937 if ($1 eq 'cut') { }
483 18 741 if $code_handler
491 0 759 if ($line =~ /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/)
507 1777 15599 if $self->{'_transcoder'}
510 39 17337 if ($line =~ /^=encoding\s+\S+\s*$/s)
511 1 38 if $self->parse_characters
515 166 17209 if ($line =~ /^=cut/s) { }
5731 11478 elsif ($line =~ /^(\s*)$/s) { }
6341 5137 elsif ($self->{'last_was_blank'}) { }
523 7 159 if $cut_handler
530 22 5709 if (defined $1 and $1 =~ /[^\S\r\n]/)
531 9 13 if $wl_handler
535 632 5098 if (not $self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq "~Verbatim")
540 5636 94 unless ($self->{'start_of_pod_block'} or $self->{'last_was_blank'})
548 2855 3486 if ($line =~ /^(=[a-zA-Z][a-zA-Z0-9]*)(\s+|$)(.*)/s) { }
717 2769 elsif ($line =~ /^\s/s) { }
551 33 2822 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 0 59 if $self->parse_characters
611 0 59 unless $line =~ /^=encoding\s+(\S+)\s*$/s
624 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)) { }
631 3 2 if ($norm_current eq $norm_e) { }
654 0 52 if $self->{'_transcoder'}
661 0 52 if $@
681 248 0 unless $n eq $norm
695 1 58 if (defined $self->{'_processed_encoding'})
717 37 1 if (defined $self->{'_processed_encoding'}) { }
723 0 37 if (not $self->{'encoding_command_statuses'}) { }
4 33 elsif ($self->{'encoding_command_statuses'}[-1]) { }
755 850 40 unless $self->{'errata'} and keys %{$$self{"errata"};}
830 934 6290 unless @{$paras = $self->{'paras'};}
838 904 5386 unless ($self->{'doc_has_started'})
857 31 873 $starting_contentless ? :
867 4283 4698 if $paras->[0][0] =~ /^=/
872 1342 51 if @$paras == 1 and $paras->[0][0] eq '=over' || $paras->[0][0] eq '=item' || $paras->[0][0] eq '~Verbatim' && $self->{'in_pod'}
901 50 7416 if ($para_type eq '=for') { }
127 7289 elsif ($para_type eq '=begin') { }
130 7159 elsif ($para_type eq '=end') { }
940 6219 elsif ($para_type eq '~end') { }
902 50 0 if $self->_ponder_for($para, $curr_open, $paras)
905 127 0 if $self->_ponder_begin($para, $curr_open, $paras)
908 130 0 if $self->_ponder_end($para, $curr_open, $paras)
911 940 0 if $self->_ponder_doc_end($para, $curr_open, $paras)
917 42 6177 if (grep $_->[1]{'~ignore'}, @$curr_open)
925 578 5599 if ($para_type eq '=pod') { }
213 5386 elsif ($para_type eq '=over') { }
209 5177 elsif ($para_type eq '=back') { }
929 4 209 if $self->_ponder_over($para, $curr_open, $paras)
932 10 199 if $self->_ponder_back($para, $curr_open, $paras)
947 6 737 if ($para_type =~ /^=head\d$/s and not $self->{'accept_heads_anywhere'} and @$curr_open and $curr_open->[-1][0] eq "=over")
962 1022 4149 if ($para_type eq '=item') { }
21 4128 elsif ($para_type eq '=extend') { }
38 4090 elsif ($para_type eq '=encoding') { }
538 3552 elsif ($para_type eq '~Verbatim') { }
2772 780 elsif ($para_type eq '~Para') { }
30 750 elsif ($para_type eq 'Data') { }
738 12 elsif ($para_type =~ s/^=//s and defined($para_type = $self->{'accept_directives'}{$para_type})) { }
965 0 1022 unless (@$curr_open and $over = (grep {$_->[0] eq "=over";} @$curr_open)[-1])
981 0 1022 if (not $over_type) { }
0 1022 elsif ($over_type eq 'block') { }
835 187 elsif ($over_type eq 'text') { }
28 159 elsif ($over_type eq 'number') { }
159 0 elsif ($over_type eq 'bullet') { }
987 0 0 unless ($curr_open->[-1][1]{'~bitched_about'})
1006 831 4 if ($item_type eq 'text') { }
4 0 elsif ($item_type eq 'number' or $item_type eq 'bullet') { }
1031 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'}) { }
1067 28 0 if (@$para == 2)
1069 25 3 if ($paras->[0][0] eq '~Para') { }
1084 159 0 if ($item_type eq 'bullet') { }
0 0 elsif ($item_type eq 'number') { }
0 0 elsif ($item_type eq 'text') { }
1087 101 58 if ($para->[1]{'~_freaky_para_hack'})
1113 58 101 if (@$para == 2)
1115 58 0 if ($paras->[0][0] eq '~Para') { }
1141 3 35 unless $self->keep_encoding_directive
1171 3340 1795 if ($para_type =~ s/^\?//s)
1172 2066 1274 if (not @$curr_open) { }
1179 1150 124 if (not @fors) { }
73 51 elsif ($fors[-1][1]{'~resolve'}) { }
1187 18 55 if ($para_type eq 'Data') { }
1202 4547 588 if ($para_type eq 'Plain') { }
534 54 elsif ($para_type eq 'Verbatim') { }
54 0 elsif ($para_type eq 'Data') { }
1220 4929 206 if $seen_legal_directive and not $self->{'~tried_gen_errata'}
1239 0 50 if (grep $_->[1]{'~ignore'}, @$curr_open)
1245 50 0 if ($para->[$i] =~ s/^\s*(\S+)\s*//s)
1250 0 50 unless (defined $target)
1282 0 127 unless (length $content)
1292 2 125 if $title
1298 33 94 if $content =~ s/^!//s
1300 52 75 if $content =~ s/^://s
1304 33 94 $neg ? :
1310 183 66 unless $self->{'accept_targets'}{$target_name}
1315 18 48 if $self->{'accept_targets'}{$target_name} eq "force_resolve"
1321 33 94 if ($neg)
1322 6 27 if ($dont_ignore) { }
1345 40 87 if (not $dont_ignore or scalar grep($_->[1]{'~ignore'}, @$curr_open)) { }
1348 87 0 unless $self->{'~tried_gen_errata'}
1362 0 130 unless (length $content)
1367 0 0 @$curr_open && $curr_open->[-1][0] eq '=for' ? :
1375 0 130 unless ($content =~ /^\S+$/)
1385 0 130 unless (@$curr_open and $curr_open->[-1][0] eq "=for")
1395 3 127 unless ($content eq $curr_open->[-1][1]{'target'})
1408 40 87 if (grep $_->[1]{'~ignore'}, @$curr_open) { }
1416 87 0 unless $self->{'~tried_gen_errata'}
1427 10 930 if (@$curr_open) { }
1446 890 40 unless ($self->{'~tried_gen_errata'})
1449 40 850 if (@extras)
1466 0 578 if @$para > 3
1472 6 572 if (my $pod_handler = $self->{'pod_handler'})
1474 3 3 $line eq '' ? :
1487 0 213 unless @$paras
1490 185 28 if ($paras->[0][0] eq '=item') { }
6 22 elsif ($paras->[0][0] eq '=back') { }
0 22 elsif ($paras->[0][0] eq '~end') { }
1495 2 4 if ($self->{'parse_empty_lists'}) { }
1517 119 90 if ($content =~ /^\s*$/s) { }
90 0 elsif ($content =~ /^\s*((?:\d*\.)?\d+)\s*$/s) { }
1522 0 90 if ($1 == 0)
1538 169 40 unless $self->{'~tried_gen_errata'}
1549 0 209 if ($content =~ /\S/)
1556 209 0 if (@$curr_open and $curr_open->[-1][0] eq '=over') { }
1560 169 40 unless $self->{'~tried_gen_errata'}
1578 0 0 unless (@$curr_open and $over = (grep {$_->[0] eq "=over";} @$curr_open)[-1])
1594 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') { }
1600 0 0 unless ($curr_open->[-1][1]{'~bitched_about'})
1619 0 0 if ($item_type eq 'text') { }
0 0 elsif ($item_type eq 'number' or $item_type eq 'bullet') { }
1644 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'}) { }
1680 0 0 if (@$para == 2)
1682 0 0 if ($paras->[0][0] eq '~Para') { }
1697 0 0 if ($item_type eq 'bullet') { }
0 0 elsif ($item_type eq 'number') { }
0 0 elsif ($item_type eq 'text') { }
1700 0 0 if ($para->[1]{'~_freaky_para_hack'})
1726 0 0 if (@$para == 2)
1728 0 0 if ($paras->[0][0] eq '~Para') { }
1749 4442 102 unless (@$para == 2 or @$para == 3 and $para->[2] eq "" or $para->[1]{'~cooked'})
1769 453 81 unless ($self->{'_output_is_for_JustPod'})
1774 2 451 if not defined $tab_width or $tab_width =~ /\D/
1779 10 443 if ($indent and ref $indent eq "CODE")
1788 32 2045 if $indent
1789 1 2076 unless $tab_width
1809 103 431 if ($self->{'accept_codes'} and $self->{'accept_codes'}{'VerbatimFormatted'}) { }
2 429 elsif ($self->{'codes_in_verbatim'}) { }
1823 395 34 if @$para > 3
1833 15 39 if @$para > 3
1850 2881 9965 if (ref $x) { }
1867 0 10 unless $self->{'curr_open'}
1871 9 6 if ($copy[0] eq '=for') { }
6 0 elsif ($copy[0] eq '=over') { }
1884 15 0 unless (@copy > 2)
1886 6 9 unless defined $copy[-1]
1928 11 444 if ($p->[$i] =~ m[^#:([ \^\/\%]*)\n?$]s) { }
1932 1 10 if ($$p[$i - 1] =~ m[^#:[ \^\/\%]*\n?$]s) { }
1954 0 10 unless (length $formatting and $$p[$i - 1] =~ /\S/)
1960 3 7 if (length $formatting >= length $$p[$i - 1]) { }
1975 32 22 if ($2) { }
1981 2 0 $5 ? :
10 2 $4 ? :
10 12 $3 ? :
2007 0 0 unless (ref $p->[$i] or ref $$p[$i + 1])
2017 103 0 unless (ref $p->[$i])
2018 103 0 if ($p->[$i] =~ s/\n$//s) { }
2056 3577 865 unless ($preserve_space or $self->{'preserve_whitespace'})
2143 3078 12805 if (defined $1) { }
126 12679 elsif (defined $4) { }
3056 9623 elsif (defined $5) { }
9623 0 elsif (defined $6) { }
2146 115 2963 if (defined $2) { }
2157 433 2645 if ('L' eq $code) { }
2158 1 432 if ($inL) { }
2170 189 2456 if $inL
2180 18 3060 if ($self->{'_output_is_for_JustPod'} and $bracket_count > 1)
2183 3 15 if $lspacer ne " "
2189 1 125 if (not @stack) { }
3 122 elsif (not $stack[-1]) { }
115 7 elsif ($stack[-1] == length $4) { }
0 7 elsif ($stack[-1] < length $4) { }
2214 3 0 if ($3 ne " " and $self->{'_output_is_for_JustPod'})
2215 1 2 if ($3 ne '') { }
1 1 elsif ($lineage[-1][1]{'~lspacer'} eq ' ') { }
2230 2 116 if 2 == @{$lineage[-1];}
2233 22 96 if ($inL == @stack)
2241 20 98 if $inL
2246 2952 104 if (@stack and not $stack[-1]) { }
2250 0 2952 if (length $5 == 2) { }
41 2911 elsif (2 == @{$lineage[-1];}) { }
2256 410 2542 if ($inL == @stack)
2268 170 2886 if $inL
2273 752 8871 if $inL
2285 8 4436 if (@stack)
2288 0 8 if 2 == @{$lineage[-1];}
2293 0 8 if ($ender_length) { }
2324 380 3583 if (ref($lol->[$i] || '') and UNIVERSAL::isa($lol->[$i], 'ARRAY')) { }
2338 0 3 unless @$curr_open
2343 4 0 $_->[0] eq '=for' ? :
2377 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') { }
2407 0 0 unless $pretty_form{$1}