Branch Coverage

blib/lib/Acme/AsciiArtinator.pm
Criterion Covered Total %
branch 129 204 63.2


line true false branch
19 0 3 if (@_ == 1 and ref $_[0] eq 'HASH')
25 0 3 if (defined $opts{'debug'} and $opts{'debug'})
29 0 3 if (defined $opts{'art_file'}) { }
0 3 elsif (defined $opts{'art_string'}) { }
3 0 elsif (defined $opts{'art'}) { }
32 0 0 unless open $fh, '<', $opts{'art_file'}
44 0 3 if (defined $opts{'code_file'}) { }
0 3 elsif ($opts{'code_string'}) { }
3 0 elsif ($opts{'code'}) { }
47 0 0 unless open $fh, '<', $opts{'code_file'}
58 0 3 if (defined $opts{'output'}) { }
61 0 3 if $DEBUG
65 0 3 if (defined $opts{'compile-check'})
73 0 0 if ($c1 > 0)
83 3 0 if defined $opts{"test_argv$ntest"}
84 2 1 if defined $opts{"test_input$ntest"}
86 3 0 if (open $fh, '>', "ascii-art-test-$ntest-$$.pl") { }
91 2 1 if (defined $opts{"test_input$ntest"}) { }
95 0 2 if $DEBUG
128 3 0 if (defined $newc)
136 0 3 if ($opts{'filler'} != 0)
150 0 3 if ($c1 > 0)
171 2 1 if (defined $opts{'test_argv1'})
179 3 0 if defined $opts{"test_argv$ntest"}
180 2 1 if defined $opts{"test_input$ntest"}
182 0 3 unless defined $Acme::AsciiArtinator::TestOutput[$ntest]
185 2 1 if (defined $opts{"test_input$ntest"}) { }
196 3 0 if ($output eq $Acme::AsciiArtinator::TestOutput[$ntest]) { }
218 0 0 if ($ipad >= $max_tries)
272 6 2110 if (substr($q, 0, length $k) eq $k)
286 0 66 if $array[$i] =~ /$word/
308 0 10 if $contexts[$c] eq 'operator'
309 0 10 if $tokens[$c] eq ';' and $tokens[$c - 1] ne 'SIGIL'
335 0 150 if $_ eq 'q' and $DEBUG
340 0 150 if ($Q =~ /^\$\#\{/ or $Q =~ /^\$\#\w+/)
350 23 127 if ($sigil{$_} and not $Q =~ /^\$\#/)
357 14 113 if (not $sigil and $_ eq q['] || $_ eq '"' || $_ eq '/' && regex_or_divide(\@tokens, \@contexts) eq 'regex') { }
4 109 elsif (not $sigil and $Q =~ /^[0-9]*\.{0,1}[0-9]+([eE][-+]?[0-9]+)?/) { }
0 109 elsif (not $sigil and $Q =~ /^[0-9]+\.{0,1}[0-9]*([eE][-+]?[0-9]+)?/) { }
3 106 elsif (not $sigil and $Q =~ /^m\W/ || $Q =~ /^qr\W/ || $Q =~ /^q[^\w\s]/ || $Q =~ /^qq\W/) { }
5 101 elsif (not $sigil and $Q =~ /^s\W/ || $Q =~ /^y\W/ || $Q =~ /^tr\W/) { }
42 59 elsif ($Q =~ /^[a-zA-Z_]\w*/) { }
6 53 elsif ($token = find_token_keyword($Q) and not $sigil) { }
366 3 77 if ($INPUT[$j] eq '\\')
370 14 63 if $INPUT[$j] eq $terminator and not $escaped
375 0 0 if ($_ eq '/' and length $token > 30 || $j >= $#INPUT)
384 0 14 if ($_ eq '/!') { }
0 14 elsif ($_ eq '/') { }
413 1 2 $Q =~ /^q[rq]\W/ ? :
421 0 22 if ($INPUT[$j] eq '\\')
425 3 19 if $INPUT[$j] eq $terminator and not $escaped
435 0 5 $_ eq 't' ? :
441 0 86 if ($INPUT[$j] eq '\\')
445 10 76 if ($INPUT[$j] eq $terminator and not $escaped)
446 5 5 if ($terminators_found++)
463 2 40 if ($token =~ /^x\d+$/)
464 2 0 if ($tokens[-1] =~ /^[\'\"]/ or $tokens[-1] eq ')' or $contexts[-1] =~ /name/)
471 19 23 if ($sigil) { }
5 18 elsif ($contexts[-1] =~ m[regular expression ([ABC]) /(.)/]) { }
482 3 2 if (do { $token =~ /x/ }) { }
1 2 elsif ($token =~ /e/ and $tokens[-2] =~ /^s/) { }
522 27 8 if (substr($regex, $t, 1) =~ /\S/)
530 1 0 if ($regex_type eq 'B')
561 4 49 if ($sigil) { }
6 43 elsif (/\s/) { }
9 34 elsif (/;/ and not $sigil) { }
8 26 elsif (m[/]) { }
6 20 elsif (m[[\+\-\*/\%\^\|\&\!\~\?\:\.]]) { }
0 20 elsif (/\{/ and $sigil) { }
0 20 elsif (/\}/ and STRPOS('name contained', @contexts) > STRPOS('name decontainer', @contexts)) { }
585 0 16 if ($DEBUG)
605 0 3 if ($endpos >= 0)
623 117 209 if ($char eq ' ' or $char eq "\n" or $char eq "\t") { }
624 22 95 if ($block_size > 0)
634 25 92 if ($char eq "\n")
641 3 0 if ($block_size > 0)
661 100 318 @code == 0 ? :
682 0 13 if ($ib > @blocks)
693 0 184 unless defined $tt
694 0 184 unless defined $bc
695 10 174 if ($tt > $bc)
696 0 10 if ($DEBUG) { }
715 0 0 if ($bc == 0 and $blocks[$ib] == 0 and $tokens[$it] eq '$' and $contexts[$it] eq 'SIGIL' and $contexts[$it + 1] eq 'name' and length $tokens[$it + 1] == 1 and $tokens[$it + 1] =~ /\W/)
730 0 30 if ($ib > @blocks)
758 6 16 if $p[$r - 1] >= $p
787 0 61 if $DEBUG
788 0 61 if $DEBUG
791 0 61 if $it == 0
792 0 61 if ($z < 0.25 and $npad > 1) { }
61 0 elsif ($z < 0.5) { }
0 0 elsif ($z < 0.5 and $npad > 1) { }
0 0 elsif ($z < 0.75) { }
796 0 0 if ($$cref[$it] eq 'name' and $$cref[$it - 1] eq 'SIGIL')
797 0 0 if $DEBUG
810 7 51 if ($it == 0 or $$tref[$it - 1] eq ';' and $$cref[$it - 1] eq 'end of statement' or $$tref[$it] eq ';' and $$cref[$it] eq 'end of statement' or $$cref[$it] eq 'flexible filler' or $$cref[$it - 1] eq 'flexible filler')
815 0 10 if $DEBUG
850 0 10 if ($where < 0 and $howmuch < 0)
851 0 0 if ($DEBUG)
858 6 4 $howmuch > 1 ? :
864 26 25 if rand() > 0.4
869 0 10 if ($tlength > $nblocks)
872 0 0 if ($DEBUG)