Branch Coverage

blib/lib/Config/IOD/Document.pm
Criterion Covered Total %
branch 224 274 81.7


line true false branch
16 0 107 unless ($attrs{'_parsed'})
19 0 107 unless ($attrs{'_parser'})
39 1 45 unless (length $name)
40 2 43 if ($name =~ /\R|\]/)
48 1 24 unless (length $name)
49 2 22 if ($name =~ /\R|=/)
50 3 19 if ($name =~ /\A(?:;|#|\[)/)
57 2 15 if ($value =~ /\R/)
63 1 1 if ($comment =~ /\R/)
69 1 4 if ($value < 1)
70 1 3 if ($value > @{$self->{'_parsed'};})
89 0 21 if (ref $_[0] eq 'HASH') { }
105 0 2 if $cur_section eq $merge
108 0 2 unless exists $res->{$merge}
116 2 19 if $parser->{'enable_expr'}
117 2 19 if $parser->{'enable_expr'}
121 0 61 if defined $opts->{'linum_start'} and $linum < $opts->{'linum_start'}
122 0 61 if defined $opts->{'linum_end'} and $linum > $opts->{'linum_end'}
125 7 54 if ($type eq 'D') { }
9 45 elsif ($type eq 'S') { }
37 8 elsif ($type eq 'K') { }
127 4 3 if ($directive eq 'merge')
130 0 4 unless (defined $args)
134 2 2 @$args ? :
139 2 7 if defined $merge and $num_seen_section_lines > 1
141 1 8 if $parser->{'enable_expr'}
149 24 13 if ($val =~ /\A["!\\[\{]/) { }
152 6 18 if $err
158 0 31 if (exists $res->{$cur_section}{$key}) { }
159 0 0 if (not $parser->{'allow_duplicate_key'}) { }
0 0 elsif ($arrayified->{$cur_section}{$key}++) { }
174 0 15 if defined $merge and $num_seen_section_lines > 1
182 1 6 if (ref $_[0] eq 'HASH') { }
199 0 31 if defined $opts->{'linum_start'} and $linum < $opts->{'linum_start'}
200 0 31 if defined $opts->{'linum_end'} and $linum > $opts->{'linum_end'}
203 15 16 if ($type eq 'S') { }
16 0 elsif ($type eq 'K') { }
209 0 16 if $skip_section
211 0 16 if $opts->{'unique_key'} and $seen_keys{$key}++
219 1 15 if $opts->{'early_exit'} and not $res
226 2 11 unless $self->{'_dump_cache'}
237 0 0 if $found
238 0 0 unless $args{'linum'} > 1
239 0 0 unless $args{'section'} eq $section
240 0 0 unless $args{'key'} eq $key
242 0 0 unless $l->[0] eq 'D'
256 1 1 if (ref $_[0] eq 'HASH') { }
268 0 8 unless $args{'section'} eq $section
269 1 7 if $opts->{'unique'} and $mem{$args{'key'}}++
285 0 0 unless $args{'section'} eq $section
286 0 0 unless $args{'key'} eq $key
297 4 14 if (ref $_[0] eq 'HASH') { }
309 21 24 unless $line->[0] eq 'S'
310 6 18 if (defined $name)
311 4 2 unless $line->[3] eq $name
313 4 16 unless $opts->{'all'}
316 10 4 unless $opts->{'all'}
323 3 1 if (ref $_[0] eq 'HASH') { }
335 1 13 if $opts->{'unique'} and $seen{$section}++
339 3 20 if $linum_end >= @$parsed
340 10 10 if $parsed->[$linum_end][0] eq 'S'
352 1 12 if $opts->{'early_exit'} and not $res
359 1 1 if (ref $_[0] eq 'HASH') { }
385 0 0 unless $args{'section'} eq $section
396 2 15 if (ref $_[0] eq 'HASH') { }
411 27 35 if ($line->[0] eq 'S')
413 17 10 if ($cur_section eq $name) { }
415 2 15 if @res and not defined $res[-1][1]
418 3 7 if @res
419 2 8 if @res and not $opts->{'all'}
423 12 5 if @res and not defined $res[-1][1]
426 2 15 if ($opts->{'all'}) { }
432 3 13 if (ref $_[0] eq 'HASH') { }
445 23 39 if ($line->[0] eq 'S')
449 1 38 unless $line->[0] eq 'K'
450 12 26 unless $cur_section eq $section
451 15 11 unless $line->[2] eq $name
452 4 7 unless $opts->{'all'}
455 9 3 unless $opts->{'all'}
462 0 2 if (ref $_[0] eq 'HASH') { }
475 2 4 if ($linum == $asked_linum)
478 1 3 if ($line->[0] eq 'S')
488 8 8 if (ref $_[0] eq 'HASH') { }
495 3 13 if $err
499 2 11 if (defined $opts->{'comment'})
501 1 1 if $err
504 2 10 if ($self->_find_section($name))
505 1 1 if ($opts->{'ignore'}) { }
513 3 7 if (defined $opts->{'linum'}) { }
2 5 elsif ($opts->{'top'}) { }
515 2 1 if $err
533 1 7 defined $opts->{'comment'} ? :
1 7 defined $opts->{'comment'} ? :
543 7 12 if (ref $_[0] eq 'HASH') { }
551 0 19 if $err_section
553 6 13 if $err_name
555 1 12 if $err_value
561 1 11 if ($opts->{'replace'})
567 2 10 unless ($line_range)
568 1 1 if ($opts->{'create_section'}) { }
576 10 1 unless (defined $linum)
578 3 7 if ($linum)
579 1 2 if ($opts->{'ignore'}) { }
1 1 elsif ($opts->{'add'}) { }
0 1 elsif ($opts->{'replace'}) { }
590 2 6 if ($opts->{'linum'}) { }
592 0 2 if $err
593 1 1 unless $self->_line_in_section($opts->{'linum'}, $section)
597 1 5 if ($opts->{'top'}) { }
601 1 4 if ($$p[$linum - 1])
602 1 0 if ($$p[$linum - 1][0] eq 'S') { }
629 2 3 if (ref $_[0] eq 'HASH') { }
636 0 5 if $err
641 2 3 if ($opts->{'all'}) { }
645 1 2 unless defined $line_ranges[0]
648 1 4 if ($opts->{'cond'})
660 0 5 unless defined $line_range
661 0 5 if $line1 < 1
666 4 1 if $num_deleted
673 3 3 if (ref $_[0] eq 'HASH') { }
680 0 6 if $err_section
682 0 6 if $err_name
687 3 3 if ($opts->{'all'}) { }
691 2 1 unless defined $linums[0]
694 1 5 if ($opts->{'cond'})
714 4 2 if $num_deleted
721 0 4 if (ref $_[0] eq 'HASH') { }
730 1 3 if $err_value
736 0 3 if $found and not $opts->{'all'}
737 1 2 unless $args{'section'} eq $section
738 1 1 unless $args{'key'} eq $key
756 182 565 if ($type eq 'B') { }
12 553 elsif ($type eq 'D') { }
63 490 elsif ($type eq 'C') { }
113 377 elsif ($type eq 'S') { }
377 0 elsif ($type eq 'K') { }
759 12 0 $abo ? :