Branch Coverage

blib/lib/Unix/ConfigFile.pm
Criterion Covered Total %
branch 46 88 52.2


line true false branch
49 0 8 if defined $opt{'lockfile'}
50 0 8 if defined $opt{'locking'}
51 0 8 if defined $opt{'mode'}
55 0 8 unless defined $fh
60 0 8 if ($this->mode eq 'r') { }
61 0 0 unless $this->lock('shared')
64 4 4 unless $this->lock
68 0 4 if (exists $opt{'readopts'}) { }
69 0 0 unless $this->read($this->fh, $opt{'readopts'})
72 0 4 unless $this->read($this->fh)
82 0 4 if $this->mode eq 'r'
84 0 4 unless my $fh = 'IO::File'->new(">$tempname")
88 0 4 if (exists $opt{'writeopts'}) { }
89 0 0 unless $this->write($fh, $opt{'writeopts'})
92 0 4 unless $this->write($fh)
95 0 4 if (defined $opt{'backup'})
106 4 0 unless $this->unlock
114 0 16 @_ ? :
121 8 8 @_ ? :
129 28 0 unless @_
131 0 0 unless grep {$lockmethod eq $_;} 'flock', 'dotlock', 'none'
139 4 0 @_ ? :
146 0 8 @_ ? :
153 20 0 unless @_
155 0 0 unless grep {$mode eq $_;} 'r', 'r+', 'w'
167 0 8 if $this->locking eq 'none'
168 0 8 if $$this{'locked'}
169 0 8 if ($this->locking eq 'flock') { }
8 0 elsif ($this->locking eq 'dotlock') { }
170 0 0 @_ ? :
175 4 4 unless defined $fh
193 0 4 if $this->locking eq 'none'
194 4 0 unless $$this{'locked'}
196 0 0 if ($this->locking eq 'flock') { }
0 0 elsif ($this->locking eq 'dotlock') { }
201 0 0 if defined $this->lockfh
239 1 63 if ($$this{'seq'}[$i] eq $data)
253 2 66 if ($$this{'seq'}[$i] eq $data)
271 1 31 $result ? :
275 34 30 if $appended
280 2 30 unless $appended
282 1 31 if $result
285 1 31 if @list
288 31 5 $result ? :