Branch Coverage

blib/lib/Class/PObject/Driver/file.pm
Criterion Covered Total %
branch 40 66 60.6


line true false branch
28 0 11 unless $$columns{'id'} ||= $self->generate_id($object_name, $props)
32 0 11 unless my $filename = $self->_filename($object_name, $props, $$columns{'id'})
35 0 11 unless (sysopen FH, $filename, 577, 438)
41 0 11 unless (flock FH, 2)
50 0 11 unless (close FH)
76 0 43 unless my $object_dir = $self->_dir($object_name, $props)
82 0 43 unless (tie %files, 'IO::Dir', $object_dir)
92 0 38 if (defined $$args{'limit'} and not $$args{'offset'} and not $$args{'sort'} and $n == $$args{'limit'})
96 86 136 if (S_ISDIR($stat->mode))
106 43 93 unless ($filename =~ /^$filef_pattern$/)
110 0 93 unless (sysopen FH, 'File::Spec'->catfile($object_dir, $filename), 0)
115 0 93 unless (flock FH, 1)
122 0 93 unless (defined $datastr)
126 69 24 if ($self->_matches_terms($data, $terms))
127 40 29 keys %$args ? :
134 26 17 unless (keys %$args)
164 0 50 unless my $filename = $self->_filename($object_name, $props, $id)
167 1 49 unless (sysopen FH, $filename, 0)
172 0 49 unless (flock FH, 1)
181 0 49 unless ($data_str)
195 0 6 unless (unlink $filename)
215 0 5 unless (File::Path::rmtree($dir))
231 0 7 unless my $dir = $self->_dir($object_name, $props)
235 0 7 unless (sysopen FH, $filename, 66)
239 0 7 unless (flock FH, 2)
244 0 7 unless (seek FH, 0, 0)
248 0 7 unless (truncate FH, 0)
253 0 7 unless (close FH)
266 0 67 unless ($object_name and defined $id)
269 0 67 unless my $dir = $self->_dir($object_name, $props)
283 0 122 unless (defined $dir)
294 5 117 unless (-e $object_dir)
296 0 5 unless (File::Path::mkpath($object_dir))