Branch Coverage

blib/lib/Bot/Cobalt/Serializer.pm
Criterion Covered Total %
branch 25 58 43.1


line true false branch
106 3 66 @args == 1 ? :
112 0 5 unless (defined $ref)
126 0 25 unless (defined $data)
141 0 3 if (not $path) { }
0 3 elsif (not defined $ref) { }
156 0 20 if (not $path) { }
0 20 elsif (not -e $path) { }
181 0 4 unless $module = $self->_types->{$type}
186 0 4 if $@
195 0 20 unless defined $path
198 0 0 if (defined $opts and ref $opts and &reftype($opts) eq 'HASH')
199 0 0 if defined $opts->{'Locking'}
202 17 3 if (&blessed($path) and $path->can('slurp_utf8')) { }
205 0 3 unless open my $in_fh, '<:encoding(UTF-8)', $path
208 3 0 if ($lock)
209 0 3 unless flock $in_fh, 1
215 3 0 if $lock
217 0 3 unless close $in_fh
226 0 3 unless $path and defined $data
231 0 0 if (defined $opts and ref $opts and &reftype($opts) eq 'HASH')
232 0 0 if defined $opts->{'Locking'}
233 0 0 if $opts->{'Timeout'}
236 0 3 unless open my $out_fh, '>>:encoding(UTF-8)', $path
239 3 0 if ($lock)
243 0 0 if $timer > $timeout
252 0 3 unless seek $out_fh, 0, 0
254 0 3 unless truncate $out_fh, 0
259 3 0 if $lock
261 0 3 unless close $out_fh