Branch Coverage

blib/lib/DataStore/CAS/FS.pm
Criterion Covered Total %
branch 149 236 63.1


line true false branch
55 0 7 unless ref $cas and ref($cas)->can('get') and ref($cas)->can('put')
61 0 7 @_ == 1 && ref $_[0] eq 'HASH' ? :
63 7 0 if (defined $p{'root'})
64 0 7 if defined $p{'root_entry'}
74 0 7 if @invalid
77 0 7 unless defined $self->dir_cache and $self->dir_cache->can('clear')
82 0 7 unless defined $root
84 2 5 unless (ref $root and ref($root)->isa('DataStore::CAS::FS::DirEnt'))
85 0 0 ref($root)->can('hash') ? :
2 0 ref $root eq 'HASH' ? :
0 2 !ref($root) ? :
100 0 7 unless ref $self->root_entry and ref($self->root_entry)->can('type') and $self->root_entry->type eq 'dir' and defined $self->root_entry->ref
106 0 7 unless $self->get_dir($self->root_entry->ref)
118 0 124 ref $hash_or_file && $hash_or_file->can('hash') ? :
123 76 48 if defined $dir
127 0 48 unless defined($file ||= $self->store->get($hash))
153 1 1 $path->resolve({'no_die', 1}) ? :
159 0 3 @_ == 1 && ref $_[0] eq 'HASH' ? :
176 21 0 if (ref $ret eq 'ARRAY')
183 0 0 if ref $$flags{'error_out'}
185 0 0 unless $$flags{'no_die'}
192 203 38 ref $path_names ? :
194 148 93 unless @$nodes
200 0 3 if defined $$flags{'mkdir_defaults'}
213 4 757 if ($ent->type eq 'symlink' and $$flags{'follow_symlinks'})
216 0 4 unless defined $target and length $target
223 0 4 if $path[0] eq ''
229 0 757 if ($ent->type ne 'dir')
230 0 0 unless ($$flags{'mkdir'} || 0) > 1
238 119 638 unless defined $name and length $name and $name ne '.'
242 9 629 if ($name eq '..')
243 0 9 unless @$nodes > 1
251 516 113 if ($$nodes[-1]{'subtree'})
252 0 516 $self->case_insensitive ? :
257 196 8 if (not defined $subnode and defined $$nodes[-1]{'dir'} || defined $ent->ref)
259 0 196 unless $$nodes[-1]{'dir'} ||= $self->get_dir($ent->ref)
263 190 6 if (defined(my $subent = $$nodes[-1]{'dir'}->get_entry($name)))
265 0 190 $self->case_insensitive ? :
272 15 614 unless ($subnode)
274 12 3 if ($$flags{'mkdir'} or $$flags{'partial'}) { }
280 6 6 @path ? :
287 0 3 unless defined $$nodes[-1]{'dir'}
303 0 10 unless ref $nodes
311 10 0 wantarray ? :
318 0 52 unless $ent->type eq 'dir'
322 45 7 if (not defined $$node{'dir'} and defined $ent->ref)
323 0 45 unless defined($$node{'dir'} = $self->get_dir($ent->ref))
327 47 5 if (defined $$node{'dir'})
330 0 103 $caseless ? :
333 6 46 if (my $t = $$node{'subtree'})
336 0 8 unless defined $subnode
337 0 8 if ref $subnode and $$subnode{'invalid'}
338 7 1 if (ref $subnode) { }
339 7 0 if $$subnode{'changed'}
354 0 4 unless ref $nodes
356 1 3 if (not $newent) { }
358 0 1 if $$nodes[-1]{'invalid'}
361 0 1 unless @$nodes > 1
369 0 1 $self->case_insensitive ? :
373 0 0 if (ref $newent eq 'HASH' or not defined $newent->name or not defined $newent->type)
374 3 0 ref $newent eq 'HASH' ? :
375 2 1 unless defined $ent_hash{'name'}
377 0 3 unless defined $ent_hash{'name'} and length $ent_hash{'name'}
379 2 1 unless defined $ent_hash{'type'}
392 10 13 if ($$_{'subtree'})
402 0 2 unless ref $nodes
406 1 1 defined $$entref->type && $$entref->type eq 'dir' ? :
407 1 1 defined $$entref->type ? :
0 0 ref $changes eq 'ARRAY' ? :
2 0 ref $changes eq 'HASH' ? :
413 1 1 $$entref->type eq 'dir' ? :
417 0 2 if (($old_dir_ref || '') ne ($new_dir_ref || '') and $$nodes[-1]{'subtree'})
432 16 9 if ($prev)
433 0 16 $self->case_insensitive ? :
436 4 21 if $$_{'changed'} and not $$_{'invalid'}
450 0 4 unless ref $nodes
451 3 1 unless (defined $$nodes[-1]{'dirent'}->type)
476 0 0 if ($$self{'_nodes'} and $$self{'_nodes'}{'changed'})
486 2 0 if ($self->_nodes and $self->_nodes->{'changed'})
488 0 2 unless $$root_node{'dirent'}->type eq 'dir'
505 10 0 if (my $subtree = $$node{'subtree'})
507 10 0 if defined $v and $v eq 0 || $$v{'changed'}
513 1 9 if not %changes and defined $$node{'dirent'}->ref
517 4 5 if (defined $$node{'dir'} or defined $$node{'dirent'}->ref)
518 0 4 unless $$node{'dir'} ||= $self->get_dir($$node{'dirent'}->ref)
524 0 12 $caseless ? :
8 4 unless $changes{$caseless ? uc $ent->name : $ent->name}
532 8 0 if ($$_{'subtree'} and $$_{'dirent'}->type eq 'dir' and $$_{'changed'})
544 0 9 unless @entries
546 4 5 if $$node{'dir'}
548 5 4 unless defined $format
576 0 0 if length $_
577 0 0 if $$name[-1] eq '' or $$name[-1] eq '.'
594 111 2 if $nodes and ref $$nodes[-1] and not $$nodes[-1]{'invalid'}
599 2 101 if ($nodes) { }
601 2 2 if not ref $_ or $$_{'invalid'}
604 0 2 ref $_ ? :
608 5 98 $flags ? :
610 100 3 if (ref $nodes) { }
614 0 3 if ref $$flags{'error_out'}
616 0 3 unless $$flags{'no_die'}
628 2 4 $$self{'_node_path'} ? :
635 1 2 $path->resolve({'no_die', 1}) ? :
649 0 2 unless $ent->type eq 'file'
650 0 2 unless defined(my $hash = $ent->ref)
663 0 0 unless $ent->type eq 'dir'
664 0 0 unless defined(my $hash = $ent->ref)
677 0 1 @_ == 1 && ref $_[0] eq 'HASH' ? :
691 0 3 @_ == 1 && ref $_[0] eq 'HASH' ? :
702 4 97 if @_ and ref $_[0] eq $class
703 0 97 unless @dirstack
709 5 50 unless @dirstack
722 42 50 if ($p->type eq 'dir')
735 0 5 unless ref($x = $$self{'fs'}->_resolve_path(undef, $$self{'path'}))
753 2 0 if @{$$self{'dirstack'};}
763 0 0 if (@_ > 1)
774 0 7 ref $_[0] ? :
795 0 48 if $$self{'_recent_idx'} > @{$$self{'_recent'};}