Branch Coverage

lib/Config/AST.pm
Criterion Covered Total %
branch 132 192 68.7


line true false branch
307 18 4 if (defined($v = delete $_{'lexicon'}))
310 0 22 if keys %_
345 18 47 if (@_)
347 0 18 if @_
348 0 18 unless ref $lexicon eq 'HASH'
362 85 56 if ($elt->[2])
367 86 55 if (ref $v eq 'HASH') { }
369 35 51 !$elt->[2] && $k eq 'section' ? :
390 0 7 unless $lex
393 1 0 $lex eq '*' ? :
18 1 ref $lex eq 'HASH' ? :
19 0 if (my $next = ref $lex eq 'HASH' ? $lex->{$k} // $lex->{'*'} : ($lex eq '*' ? $lex : undef)) { }
397 12 7 if (ref $lex eq 'HASH') { }
2 5 elsif ($lex eq '*') { }
398 11 1 if ($next = $lex->{'section'})
399 11 0 if @_
410 2 5 if @_
478 0 23 if keys %opts
479 19 4 if ($lexicon)
480 3 16 if $lint
511 32 51 unless ref $d eq 'HASH'
513 4 47 if (exists $d->{'default'} and not $section->has_key($k))
517 1 3 ref $d->{'default'} eq 'CODE' ? :
518 0 4 if (exists $d->{'section'}) { }
533 36 15 if (exists $d->{'section'})
534 6 30 if ($k eq '*') { }
535 3 3 if (keys %{$section->subtree;}) { }
537 2 2 if (my $sel = $d->{'select'}) { }
2 0 elsif ($vref->is_section) { }
538 0 2 if ($self->$sel($vref, @path, $name))
550 1 2 if ($node->keys > 0)
561 1 0 unless ($h{$p})
572 9 21 unless ($node = $section->subtree($k))
575 30 0 if (not exists $d->{'select'} or $self->${\$d->{'select'};}($node, @path, $k))
579 21 9 if ($node->keys > 0)
585 4 47 if ($d->{'mandatory'} and not $section->has_key($k))
587 1 3 exists $d->{'section'} ? :
609 40 0 if ($self->root)
631 0 0 if $_{'locus'}
648 0 0 unless $self->{'_debug'} >= $lev
692 0 22 if $self->root->empty
695 3 29 unless $node = $node->subtree($_)
711 0 5 unless @_
712 5 0 if (my $node = $self->getnode(@_))
828 0 10 if @_ or not $self->lexicon
835 21 0 if $self->root
849 63 0 if (defined $kw)
850 63 0 if (ref $kw eq 'HASH')
852 28 35 if (exists $kw->{$name}) { }
35 0 elsif (exists $kw->{'*'}) { }
856 33 2 if ($synt eq '*')
860 29 0 if (defined $synt and ref $synt eq 'HASH' and exists $synt->{'section'})
892 48 0 unless (ref $path eq 'ARRAY')
904 0 63 unless ($tree->is_section)
911 1 62 unless ($kw)
917 28 34 if (my $subtree = $tree->subtree($name)) { }
932 1 46 unless (defined $x)
938 2 44 if ($node->is_section)
939 1 1 if ($tree->has_key($name)) { }
950 9 35 if (ref $x eq 'HASH')
951 1 8 if (exists $x->{'section'})
960 2 6 if ($tree->has_key($name))
965 0 8 if (exists $x->{'re'})
966 0 0 unless ($v =~ /$x->{'re'}/)
975 1 7 if (my $ck = $x->{'check'})
976 1 0 unless ($self->$ck(\$v, $prev_val, $locus))
982 0 7 if ($nchecks and 0)
986 3 4 if ($x->{'array'})
987 1 2 if (not defined $prev_val) { }
998 3 39 if ($newnode = $tree->subtree($name)) { }
1039 0 1 unless $node->is_section
1041 1 0 if (my $n = $node->subtree($arg)) { }
1069 0 1 if $self->root->empty
1074 1 1 unless $node->is_section and $node->has_key($_)
1082 0 0 unless $loc->[0]->keys == 0
1114 0 1 unless defined $node and $node->is_section
1217 4 9 unless ref $lexicon eq 'HASH'
1218 7 6 if (exists $lexicon->{'section'}) { }
1219 0 7 unless $node->is_section
1221 1 5 if $node->is_section
1224 2 10 if (exists $lexicon->{'select'} and not $self->${\$lexicon->{'select'};}($node, @path))
1229 5 5 if ($node->is_section) { }
1235 0 5 if (ref $val eq 'ARRAY')
1236 0 0 if ($lexicon->{'array'}) { }
1239 0 0 if (exists $lexicon->{'re'})
1240 0 0 unless ($v =~ /$lexicon->{'re'}/)
1246 0 0 if (my $ck = $lexicon->{'check'})
1247 0 0 @ar ? :
0 0 unless ($self->$ck(\$v, @ar ? $ar[-1] : undef, $node->locus))
1262 0 5 if (exists $lexicon->{'re'})
1263 0 0 unless ($val =~ /$lexicon->{'re'}/)
1270 0 5 if (my $ck = $lexicon->{'check'})
1271 0 0 unless ($self->$ck(\$val, undef, $node->locus))
1285 10 5 if (exists $lexicon->{$var}) { }
3 2 elsif (exists $lexicon->{'*'}) { }
1 1 elsif ($value->is_section) { }