Branch Coverage

blib/lib/DataStore/CAS.pm
Criterion Covered Total %
branch 46 104 44.2


line true false branch
29 15 0 unless not $ref and defined $_[0] or $ref->isa("Path::Class::File") or $ref->isa("Path::Tiny")
37 18 5 if not $ref or $ref eq "SCALAR"
39 4 1 if $ref->isa("DataStore::CAS::File") or _thing_stringifies_to_filename($_[1])
42 1 0 if $ref->isa("IO::Handle") or &Scalar::Util::reftype($_[1]) eq "GLOB"
51 0 17 ref $_[1] eq 'SCALAR' ? :
54 0 17 if (ref $$ref)
60 0 17 unless utf8::downgrade($$ref, 1)
65 0 17 $flags && $flags->{'known_hashes'} && $flags->{'known_hashes'}{$self->digest} ? :
67 1 16 if ($self->get($hash)) { }
70 0 1 if $flags->{'stats'}
73 1 15 $flags ? :
86 0 6 unless defined $file and $is_cas_file || $is_filename
89 0 6 $flags->{'known_hashes'} ? :
91 0 2 if ($is_cas_file and $flags->{'reuse_hash'})
98 2 0 $is_cas_file && $file->can('local_file') ? :
4 2 $is_filename ? :
101 6 0 if ($known_hashes{$self->digest} or defined $fname and -f $fname)
105 5 1 if ($self->get($hash))
107 0 5 if $flags->{'stats'}
109 0 5 if $flags->{'move'} and defined $fname
116 1 0 if ($is_cas_file) { }
0 0 elsif ($ref and $ref->can('openr')) { }
0 0 elsif ($is_filename) { }
117 0 1 unless $fh = $file->open
120 0 0 unless $fh = $file->openr
123 0 0 unless open $fh, "<", $fname
130 1 0 if $hash and $flags->{'move'}
136 0 1 if $flags->{'dry_run'}
138 1 0 if ($is_cas_file) { }
143 0 0 if (ref $file and ref($file)->isa("File::Temp"))
148 0 0 unless unlink "$file"
161 2 2 if ($got) { }
0 2 elsif (not defined $got) { }
162 0 2 unless $h_out->_write_all($buf)
164 0 0 if $!{'EINTR'} or $!{'EAGAIN'}
186 17 6 ref $_[0] ? :
191 0 9 unless open my $fh, "<", $file
201 0 0 unless defined $file
210 0 0 if $flags->{'stats'}
215 0 0 defined $new_hash && $new_hash eq $hash ? :
245 3 1 if @_ == 0
247 0 1 if @_ > 1
249 1 0 if @_ == 1 and not ref $_[0]
261 2 2 if exists $_[0]{$attr}
279 0 19 unless $fields
306 0 0 wantarray ? :
326 0 0 unless wantarray or not defined wantarray
337 0 0 $_[0]->read($c, 1) ? :
346 18 0 if defined $wrote and $wrote eq length $str
347 0 0 unless defined $wrote or $!{'EINTR'} or $!{'EAGAIN'}
355 0 0 defined $, ? :
356 0 0 if defined $\