Condition Coverage

blib/lib/DataStore/CAS/Simple.pm
Criterion Covered Total %
condition 61 139 43.8


and 3 conditions

line !l l&&!r l&&r condition
242 0 0 27 print $f $content and close $f
252 0 0 36 defined $str and length $str
322 2 2 5 $ref && $ref->isa('DataStore::CAS::File')
324 0 1 8 defined $file and $is_cas_file || $is_filename
328 4 1 1 $flags->{'move'} and not $is_cas_file
329 0 0 3 $is_cas_file && $file->can('local_file')
332 0 0 4 $fname and -f $fname
336 1 0 3 $is_cas_file and $flags->{'reuse_hash'}
368 1 0 0 ref $file and ref($file)->isa("File::Temp")
378 1 0 0 $uid and $uid != $>
1 0 0 $gid and $gid != $)
404 0 0 2 defined $mode and not $mode & 146
407 0 2 0 !$uid || $uid == $> and !$gid || $gid == $)
427 1 0 17 $flags->{'known_hashes'} && $flags->{'known_hashes'}{$self->digest}
428 1 0 17 defined $known_hash and length $known_hash
455 0 9 9 defined $wrote and $wrote > 0
510 0 0 17 $self->path_for_hash($hash, 1) and rename $source_file, $dest_name
539 2 0 0 $flags and $flags->{'layer'}
576 0 0 12 $#dirstack == $#length and -f $fname
590 1 0 0 $flags and $flags->{'dry_run'}
592 1 0 0 $flags and $flags->{'stats'}
596 0 0 0 $flags and $flags->{'stats'}

or 2 conditions

line l !l condition
110 9 2 $params{'digest'} ||= "SHA-1"
113 4 7 $params{'fanout'} ||= [1, 2]
179 0 0 length $hash || 0
196 0 0 length $hash || 0
202 81 0 length $hash || 0
324 0 0 $file || '(undef)'
378 0 0 chown $>, $), $tmp or die "chown($> $), $tmp): $!\n"
380 1 0 chmod 0444, $tmp or die "chmod(0444, $tmp): $!\n"
388 0 0 $flags->{'stats'}{'new_files'} ||= []
417 0 0 $flags->{'stats'}{'new_files'} ||= []
426 17 1 $flags ||= {}
450 0 18 $offset ||= 0
452 0 18 $offset || 0
516 0 0 $flags->{'stats'}{'new_files'} ||= []
548 44 0 $_[0] || die("opendir: $!")
553 0 3 $flags ||= {}
590 1 0 $path || die("unlink: $!")

or 3 conditions

line l !l&&r !l&&!r condition
124 0 9 0 ref $_[0] || $_[0]
267 0 0 0 $_ eq "=" or $_ eq "*"
324 5 4 0 $is_cas_file || $is_filename
328 3 5 1 $flags->{'hardlink'} or $flags->{'move'} and not $is_cas_file
338 1 3 0 $known_hashes{$self->digest} ||= $self->calculate_file_hash($fname)
378 0 0 1 $uid and $uid != $> or $gid and $gid != $)
407 2 0 0 !$uid || $uid == $>
2 0 0 !$gid || $gid == $)
412 0 2 0 $flags->{'dry_run'} or link $file, $dest
451 0 9 9 $count ||= length($buffer) - $offset
510 0 0 17 $flags->{'dry_run'} or rename "$source_file", $dest_name
0 17 0 $flags->{'dry_run'} or rename "$source_file", $dest_name or $self->path_for_hash($hash, 1) and rename $source_file, $dest_name
606 23 3 0 $digest_name || $self->digest