Branch Coverage

blib/lib/MDOM/Document/Gmake.pm
Criterion Covered Total %
branch 132 152 86.8


line true false branch
42 1501 22 unless ($res)
51 0 75 ref $_[0] ? :
53 0 75 unless defined $input
55 75 0 if (ref $input) { }
56 0 75 unless open $in, '<', $input
58 0 0 unless open $in, $input
74 0 165 unless /\n$/s
75 131 34 if ($context == 4 or $context == 3) { }
6 28 elsif ($context == 1) { }
8 20 elsif ($context == 2) { }
20 0 elsif ($context == 5) { }
76 4 127 if ($context == 4 and s/(?x) ^ (\t\s*) (?= \# ) //) { }
33 94 elsif ($context == 3 and s/^\t//) { }
82 1 3 if ($tokens[-1]->isa('MDOM::Token::Continuation'))
97 4 29 if ($tokens[-1]->isa('MDOM::Token::Continuation'))
102 3 1 if ($tokens[-1]->class =~ /Bare$/) { }
115 2 92 if (@tokens >= 2 and $tokens[-1]->isa('MDOM::Token::Continuation') and $tokens[-2]->isa('MDOM::Token::Comment')) { }
12 80 elsif ($tokens[-1]->isa('MDOM::Token::Continuation')) { }
137 3 3 if ($tokens[-1]->isa('MDOM::Token::Continuation')) { }
153 4 4 if ($tokens[-1]->isa('MDOM::Token::Continuation')) { }
158 6 6 if ($token->class =~ /Interpolation/ or $self->last_token->class =~ /Interpolation/) { }
172 2 4 if ($token->class =~ /Interpolation/ or $self->last_token->class =~ /Interpolation/) { }
183 0 20 if (@tokens >= 2 and $tokens[-1]->isa('MDOM::Token::Continuation') and $tokens[-2]->isa('MDOM::Token::Comment')) { }
8 12 elsif ($tokens[-1]->isa('MDOM::Token::Continuation')) { }
199 0 75 if ($context != 3 and $context != 4)
214 286 1041 if (/(?x) \G [\s\n]+ /cg) { }
77 964 elsif (/(?x) \G (?: :: | := | \?= | \+= | [=:;] )/cg) { }
3 961 elsif (/(?x) \G \| /cg) { }
15 946 elsif (my $res = _extract_interp($_)) { }
7 939 elsif (/(?x) \G \$. /cg) { }
24 915 elsif (/(?x) \G \\ ([\#\\\n:]) /cgs) { }
2 913 elsif (/(?x) \G (\# [^\n]*) \\ \n/cgs) { }
12 901 elsif (/(?x) \G \# [^\n]* /cg) { }
809 92 elsif (/(?x) \G . /cg) { }
233 20 4 if ($c eq "\n") { }
234 1 19 if $pending_token ne ''
244 0 2 if $pending_token ne ''
255 400 813 if ($next_token)
256 204 196 if ($pending_token ne '')
276 7 9 if ($whitespace)
283 45 562 if ($s =~ /(?x) \G \n /cg) { }
11 551 elsif (my $res = _extract_interp($s)) { }
11 540 elsif ($s =~ /(?x) \G \$. /cg) { }
12 528 elsif ($s =~ /(?x) \G \\ ([\#\\\n:]) /cgs) { }
472 56 elsif ($s =~ /(?x) \G . /cg) { }
295 8 4 if ($c eq "\n" and pos $s == $strlen) { }
306 75 532 if ($next_token)
307 60 15 if ($pending_token)
314 56 551 if $last
316 0 56 if ($pending_token)
328 6 128 if (/(?x) \G \n /cg) { }
4 124 elsif (/(?x) \G \\ ([\\\n#:]) /cgs) { }
124 0 elsif (/(?x) \G . /cg) { }
329 6 0 if $pending_token ne ''
336 4 0 if ($c eq "\n") { }
337 4 0 if $pending_token ne ''
359 8 86 if (@tokens == 1)
365 81 5 if ($fst)
366 2 79 if ($fst eq '-include') { }
12 67 elsif ($fst eq 'override' and $snd and $snd eq 'define' or _is_keyword($fst)) { }
375 14 67 if ($is_directive)
382 9 63 if (@sep >= 2 and $sep[0] =~ /^::?$/ and $sep[1] eq ';') { }
2 61 elsif (@sep >= 2 and $sep[0] eq ':' and $sep[1] =~ /^::?$/) { }
36 25 elsif (@sep == 1 and $sep[0] =~ /^::?$/) { }
15 10 elsif (@sep and $sep[0] =~ /(?x) ^ (?: = | := | \+= | \?= ) $/) { }
5 5 elsif (all sub { $_->isa('MDOM::Token::Whitespace') unless $_->isa('MDOM::Token::Comment'); } , @tokens) { }
390 6 3 if ($tokens[0] and $tokens[0]->isa('MDOM::Token::Whitespace'))
395 0 9 if ($tokens[-1]->isa('MDOM::Token::Continuation'))
403 5 4 if $context == 4
412 1 1 if (@tokens)
414 1 0 if ($tokens[0] and $tokens[0]->isa('MDOM::Token::Whitespace'))
419 0 1 if ($tokens[-1]->isa('MDOM::Token::Continuation'))
428 2 0 if $context == 4
436 30 6 if $context == 4
444 1 14 if $context == 3
448 15 5 unless $_->isa('MDOM::Token::Comment')