Branch Coverage

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


line true false branch
38 0 615 $] le 5.006002 ? :
42 0 615 if $@
46 0 615 if $@
49 615 0 if $matches
57 67 0 unless defined &Pod::Simple::BlackBox::DEBUG
147 0 19018 if ($self->{'source_dead'})
152 888 18130 unless (defined $source_line)
164 17246 884 if ($self->{'line_count'}++) { }
172 0 884 if (($line = $source_line) =~ s/^$utf8_bom//s) { }
0 884 elsif ($line =~ s/^\xFE\xFF//s) { }
0 884 elsif ($line =~ s/^\xFF\xFE//s) { }
208 21 16261 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 1697 16433 unless ($self->{'in_pod'})
462 939 758 if ($line =~ /^=([a-zA-Z][a-zA-Z0-9]*)(?:\s|$)/s) { }
463 4 935 if ($1 eq 'cut') { }
483 18 740 if $code_handler
491 0 758 if ($line =~ /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/)
507 1777 15591 if $self->{'_transcoder'}
510 39 17329 if ($line =~ /^=encoding\s+\S+\s*$/s)
511 1 38 if $self->parse_characters
515 165 17202 if ($line =~ /^=cut/s) { }
5728 11474 elsif ($line =~ /^(\s*)$/s) { }
6337 5137 elsif ($self->{'last_was_blank'}) { }
523 6 159 if $cut_handler
530 24 5704 if (defined $1 and $1 =~ /[^\S\r\n]/)
531 9 15 if $wl_handler
535 631 5096 if (not $self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq '~Verbatim')
540 5633 94 unless ($self->{'start_of_pod_block'} or $self->{'last_was_blank'})
548 2853 3484 if ($line =~ /^(=[a-zA-Z][a-zA-Z0-9]*)(\s+|$)(.*)/s) { }
715 2769 elsif ($line =~ /^\s/s) { }
551 33 2820 if $2 and $2 ne ' '
565 173 542 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 848 40 unless $self->{'errata'} and keys %{$$self{'errata'};}
830 932 6285 unless @{$paras = $self->{'paras'};}
838 902 5383 unless ($self->{'doc_has_started'})
857 31 871 $starting_contentless ? :
867 4281 4694 if $paras->[0][0] =~ /^=/
872 1342 50 if @$paras == 1 and $paras->[0][0] eq '=over' || $paras->[0][0] eq '=item' || $paras->[0][0] eq '~Verbatim' && $self->{'in_pod'}
901 50 7410 if ($para_type eq '=for') { }
127 7283 elsif ($para_type eq '=begin') { }
130 7153 elsif ($para_type eq '=end') { }
938 6215 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 938 0 if $self->_ponder_doc_end($para, $curr_open, $paras)
917 42 6173 if (grep $_->[1]{'~ignore'}, @$curr_open)
925 577 5596 if ($para_type eq '=pod') { }
213 5383 elsif ($para_type eq '=over') { }
209 5174 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 736 if ($para_type =~ /^=head\d$/s and not $self->{'accept_heads_anywhere'} and @$curr_open and $curr_open->[-1][0] eq '=over')
962 1022 4146 if ($para_type eq '=item') { }
21 4125 elsif ($para_type eq '=extend') { }
38 4087 elsif ($para_type eq '=encoding') { }
536 3551 elsif ($para_type eq '~Verbatim') { }
2772 779 elsif ($para_type eq '~Para') { }
30 749 elsif ($para_type eq 'Data') { }
737 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 3338 1794 if ($para_type =~ s/^\?//s)
1172 2064 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 4546 586 if ($para_type eq 'Plain') { }
532 54 elsif ($para_type eq 'Verbatim') { }
54 0 elsif ($para_type eq 'Data') { }
1220 4926 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 928 if (@$curr_open) { }
1446 888 40 unless ($self->{'~tried_gen_errata'})
1449 40 848 if (@extras)
1466 0 577 if @$para > 3
1472 6 571 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 4441 102 unless (@$para == 2 or @$para == 3 and $para->[2] eq '' or $para->[1]{'~cooked'})
1769 451 81 unless ($self->{'_output_is_for_JustPod'})
1773 2 449 if not defined $self->expand_verbatim_tabs or $self->expand_verbatim_tabs =~ /\D/
1778 10 441 if ($indent and ref $indent eq 'CODE')
1787 32 2042 if $indent
1788 1 2073 unless $self->expand_verbatim_tabs
1808 102 430 if ($self->{'accept_codes'} and $self->{'accept_codes'}{'VerbatimFormatted'}) { }
2 428 elsif ($self->{'codes_in_verbatim'}) { }
1822 395 33 if @$para > 3
1832 15 39 if @$para > 3
1849 2881 9962 if (ref $x) { }
1866 0 10 unless $self->{'curr_open'}
1870 9 6 if ($copy[0] eq '=for') { }
6 0 elsif ($copy[0] eq '=over') { }
1883 15 0 unless (@copy > 2)
1885 6 9 unless defined $copy[-1]
1927 11 444 if ($p->[$i] =~ m[^#:([ \^\/\%]*)\n?$]s) { }
1931 1 10 if ($$p[$i - 1] =~ m[^#:[ \^\/\%]*\n?$]s) { }
1953 0 10 unless (length $formatting and $$p[$i - 1] =~ /\S/)
1959 3 7 if (length $formatting >= length $$p[$i - 1]) { }
1974 32 22 if ($2) { }
1980 2 0 $5 ? :
10 2 $4 ? :
10 12 $3 ? :
2006 0 0 unless (ref $p->[$i] or ref $$p[$i + 1])
2016 102 0 unless (ref $p->[$i])
2017 102 0 if ($p->[$i] =~ s/\n$//s) { }
2055 3576 865 unless ($preserve_space or $self->{'preserve_whitespace'})
2142 3078 12804 if (defined $1) { }
126 12678 elsif (defined $4) { }
3056 9622 elsif (defined $5) { }
9622 0 elsif (defined $6) { }
2145 115 2963 if (defined $2) { }
2156 433 2645 if ('L' eq $code) { }
2157 1 432 if ($inL) { }
2169 189 2456 if $inL
2179 18 3060 if ($self->{'_output_is_for_JustPod'} and $bracket_count > 1)
2182 3 15 if $lspacer ne ' '
2188 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) { }
2213 3 0 if ($3 ne ' ' and $self->{'_output_is_for_JustPod'})
2214 1 2 if ($3 ne '') { }
1 1 elsif ($lineage[-1][1]{'~lspacer'} eq ' ') { }
2229 2 116 if 2 == @{$lineage[-1];}
2232 22 96 if ($inL == @stack)
2240 20 98 if $inL
2245 2952 104 if (@stack and not $stack[-1]) { }
2249 0 2952 if (length $5 == 2) { }
41 2911 elsif (2 == @{$lineage[-1];}) { }
2255 410 2542 if ($inL == @stack)
2267 170 2886 if $inL
2272 752 8870 if $inL
2284 8 4435 if (@stack)
2287 0 8 if 2 == @{$lineage[-1];}
2292 0 8 if ($ender_length) { }
2323 380 3604 if (ref($lol->[$i] || '') and UNIVERSAL::isa($lol->[$i], 'ARRAY')) { }
2337 0 3 unless @$curr_open
2342 4 0 $_->[0] eq '=for' ? :
2376 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') { }
2406 0 0 unless $pretty_form{$1}