Branch Coverage

lib/Config/Grammar.pm
Criterion Covered Total %
branch 119 210 56.6


line true false branch
41 0 10 if ($line =~ s/^"((?:\\.|[^"])*)"\s*//) { }
0 10 elsif ($line =~ s/^'((?:\\.|[^'])*)'\s*//) { }
10 0 elsif ($line =~ s/^((?:\\.|[^\s])*)(?:\s+|$)//) { }
70 0 14 if (defined $g->{'_mandatory'})
72 0 0 unless (defined $g->{$_})
75 0 0 unless (defined $c->{$_})
76 0 0 if (defined $section) { }
83 0 0 if (defined $g->{$_}{'_is_section'}) { }
0 0 elsif ($_ eq '_table') { }
100 53 11 unless ref $c->{$_} eq 'HASH'
101 0 11 unless defined $c->{$_}{'_is_section'}
102 6 5 defined $section ? :
0 11 unless $self->_check_mandatory($$g{$c->{$_}{'_grammar'}}, $c->{$_}, defined $section ? "$section/$_" : "$_")
106 0 11 if exists $c->{$_}{'_order_count'}
120 0 12 unless (defined $self->{'grammar'}{'_sections'})
127 10 7 if ($name eq $_)
134 2 0 if (m[^/(.*)/$])
135 2 0 if ($name =~ /^$1$/)
151 10 4 if ($g->{'_vars'})
153 20 14 if exists $c->{$var}
155 6 8 if exists $g->{$var}{'_default'}
156 8 6 unless defined $value
169 1 4 if (defined $self->{'section'}) { }
178 0 5 unless defined $s
179 0 5 unless (defined $self->{'grammar'}{$s})
192 0 5 if ($self->{'grammar'}{'_inherited'})
194 0 0 unless exists $self->{'cfg'}{$var}
196 0 0 unless defined $value
197 0 0 if ref $value
204 0 5 if (defined $self->{'grammar'}{'_order'})
205 0 0 if (defined $self->{'cfg'}{'_order_count'}) { }
213 0 5 if (defined $self->{'cfg'}{$name})
226 0 5 if (defined $self->{'grammar'}{'_varlist'})
234 0 5 if defined $order
250 9 2 if (defined $self->{'section'})
251 4 5 if ($self->{'section'} =~ m[/]) { }
279 0 15 unless $self->_check_text($self->{'section'})
281 9 6 if ($level > $self->{'level'}) { }
282 0 9 if ($level > $self->{'level'} + 1)
286 0 9 unless $self->_next_level($name)
293 3 3 if ($level != 0)
295 0 3 unless $self->_next_level($name)
310 0 19 unless (defined $self->{'grammar'}{'_vars'})
317 18 20 if ($name eq $_)
324 0 1 if (m[^/(.*)/$])
325 0 0 if ($name =~ /^$1$/)
343 0 5 unless defined $gn
346 0 5 if (defined $self->{'grammar'}{'_varlist'})
350 5 0 if (defined $self->{'grammar'}{$gn})
354 3 2 if (defined $g->{'_re'})
355 0 3 unless ($value =~ /^$g->{'_re'}$/)
356 0 0 if (defined $g->{'_re_error'}) { }
365 2 3 if (defined $g->{'_sub'})
367 1 1 if (defined $error)
374 0 4 if ref $varlistref
387 0 4 unless (defined $g)
396 0 4 if (defined $columns and $#l + 1 != $columns)
406 3 7 unless defined $gc
409 6 1 if (defined $gc->{'_re'})
410 0 6 unless ($c =~ /^$gc->{'_re'}$/)
411 0 0 if (defined $gc->{'_re_error'}) { }
420 1 6 if (defined $gc->{'_sub'})
422 1 0 if (defined $error)
431 3 0 if (defined $g->{'_key'}) { }
433 0 3 if ($kn < 0 or $kn > $#l)
438 0 3 if (defined $self->{'cfg'}{$k})
467 14 1 unless defined $g
470 1 0 if (defined $self->{'cfg'}{'_text'})
475 0 1 if (defined $g->{'_re'})
476 0 0 unless ($self->{'cfg'}{'_text'} =~ /^$g->{'_re'}$/)
477 0 0 if (defined $g->{'_re_error'}) { }
486 0 1 if (defined $g->{'_sub'})
488 0 0 if (defined $error)
504 0 39 if (/^\@include\s+["']?(.*)["']?$/)
506 0 0 if ($^O eq 'win32' and not $inc =~ m(^(?:[a-z]:)?[/\\])i and $self->{'file'} =~ m[^(.+)[\\/][^/]+$] or not $inc =~ m[^/] and $self->{'file'} =~ m[^(.+)/[^/]+$])
512 0 0 unless $self->_parse_file($inc)
517 1 38 if (/^\@define\s+(\S+)\s+(.*)$/)
522 13 25 if (defined $self->{'defines'})
528 6 32 if (/^\*\*\*\s*(.*?)\s*\*\*\*$/)
530 0 6 unless $self->_goto_level(1, $name)
531 0 6 unless $self->_check_section_sub($name)
534 6 26 if (/^(\++)\s*(.*)$/)
537 0 6 unless $self->_goto_level($level + 1, $name)
538 0 6 unless $self->_check_section_sub($name)
542 3 23 if (defined $self->{'grammar'}{'_text'})
543 0 3 unless $self->_parse_text($source)
546 19 4 if (/^(\S+)\s*=\s*(.*)$/)
547 1 18 if (defined $self->{'cfg'}{$1})
548 1 0 if (exists $self->{'cfg'}{'_inherited'}{$1}) { }
557 2 17 unless $self->_set_variable($1, $2)
561 1 3 unless $self->_parse_table($_)
570 2 10 if (defined $g->{'_sub'})
572 0 2 if (defined $error)
585 0 6 unless ($file)
590 0 6 if $self->{'encoding'}
591 0 6 unless (open $fh, $mode, "$file")
605 12 39 if $_ eq ''
609 0 0 unless defined $n
617 3 36 unless ($self->_parse_line($_, $source))
629 0 1 unless defined $pod
638 0 3 unless defined $pod
647 0 0 unless defined $pod
666 2 1 unless $self->_parse_file($file)
668 0 1 unless $self->_goto_level(0, undef)
674 0 1 unless $self->_check_mandatory($self->{'grammar'}, $self->{'cfg'}, undef)