Branch Coverage

blib/lib/DataStore/CAS.pm
Criterion Covered Total %
branch 47 110 42.7


line true false branch
29 3 15 !$ref ? :
36 0 0 !&Scalar::Util::blessed($_[0]) ? :
0 0 !ref($_[0]) ? :
0 0 !defined($_[0]) ? :
44 18 5 if not $ref or $ref eq "SCALAR"
46 4 1 if $ref->isa("DataStore::CAS::File") or _thing_stringifies_to_filename($_[1])
49 1 0 if $ref->isa("IO::Handle") or &Scalar::Util::reftype($_[1]) eq "GLOB"
58 0 17 ref $_[1] eq 'SCALAR' ? :
61 0 17 if (ref $$ref)
67 0 17 unless utf8::downgrade($$ref, 1)
72 0 17 $flags && $flags->{'known_hashes'} && $flags->{'known_hashes'}{$self->digest} ? :
74 1 16 if ($self->get($hash)) { }
77 0 1 if $flags->{'stats'}
80 1 15 $flags ? :
93 0 6 unless $is_cas_file or $is_filename
96 0 6 $flags->{'known_hashes'} ? :
98 0 2 if ($is_cas_file and $flags->{'reuse_hash'})
105 2 0 $is_cas_file && $file->can('local_file') ? :
4 2 $is_filename ? :
108 6 0 if ($known_hashes{$self->digest} or defined $fname and -f $fname)
112 5 1 if ($self->get($hash))
114 0 5 if $flags->{'stats'}
116 0 5 if $flags->{'move'} and defined $fname
123 1 0 if ($is_cas_file) { }
0 0 elsif ($ref and $ref->can('openr')) { }
0 0 elsif ($is_filename) { }
124 0 1 unless $fh = $file->open
127 0 0 unless $fh = $file->openr
130 0 0 unless open $fh, "<", $fname
137 1 0 if $hash and $flags->{'move'}
143 0 1 if $flags->{'dry_run'}
145 1 0 if ($is_cas_file) { }
150 0 0 if (ref $file and ref($file)->isa("File::Temp"))
155 0 0 unless unlink "$file"
168 2 2 if ($got) { }
0 2 elsif (not defined $got) { }
169 0 2 unless $h_out->_write_all($buf)
171 0 0 if $!{'EINTR'} or $!{'EAGAIN'}
193 17 6 ref $_[0] ? :
198 0 9 unless open my $fh, "<", $file
208 0 0 unless defined $file
217 0 0 if $flags->{'stats'}
222 0 0 defined $new_hash && $new_hash eq $hash ? :
252 3 1 if @_ == 0
254 0 1 if @_ > 1
256 1 0 if @_ == 1 and not ref $_[0]
268 2 2 if exists $_[0]{$attr}
286 0 19 unless $fields
313 0 0 wantarray ? :
333 0 0 unless wantarray or not defined wantarray
344 0 0 $_[0]->read($c, 1) ? :
353 18 0 if defined $wrote and $wrote eq length $str
354 0 0 unless defined $wrote or $!{'EINTR'} or $!{'EAGAIN'}
362 0 0 defined $, ? :
363 0 0 if defined $\