Branch Coverage

blib/lib/Stow.pm
Criterion Covered Total %
branch 270 370 72.9


line true false branch
145 0 156 unless exists $opts{$required_arg}
151 115 821 exists $opts{$opt} ? :
154 0 78 if (%opts)
170 0 78 unless $self->{'test_mode'}
172 78 0 unless exists $ENV{'TEST_VERBOSE'}
173 0 0 unless length $ENV{'TEST_VERBOSE'}
176 0 0 unless $ENV{'TEST_VERBOSE'} =~ /^\d+$/
199 3 78 if (defined $dir)
271 0 37 unless (-d $path)
275 14 23 if ($self->{'compat'}) { }
310 0 41 unless (-d $path)
342 0 121 unless chdir $self->{'target'}
374 1 93 if $self->should_skip_target_which_is_stow_dir($target)
382 0 93 unless -d $path
384 0 93 unless $self->is_a_node($target)
387 0 93 unless opendir my $DIR, $path
394 93 233 if $node eq '.'
395 93 140 if $node eq '..'
397 16 124 if $self->ignore($stow_path, $package, $node_target)
399 7 117 if ($self->{'dotfiles'})
440 0 124 if (-l $source)
442 0 0 if ($second_source =~ m[\A/])
454 19 105 if ($self->is_a_link($target)) { }
31 74 elsif ($self->is_a_node($target)) { }
10 64 elsif ($self->{'no-folding'} and -d $path and not -l $path) { }
457 0 19 unless ($existing_source)
465 1 18 unless ($existing_path)
475 17 1 if ($self->is_a_node($existing_path)) { }
476 5 12 if ($existing_source eq $source) { }
1 11 elsif ($self->defer($target)) { }
1 10 elsif ($self->override($target)) { }
9 1 elsif ($self->is_a_dir(join_paths(parent($target), $existing_source)) and $self->is_a_dir(join_paths(parent($target), $source))) { }
528 25 6 if ($self->is_a_dir($target)) { }
537 2 4 if ($self->{'adopt'}) { }
579 3 225 if ($target eq $self->{'stow_path'})
584 14 211 if ($self->marked_stow_dir($target))
597 16 1416 if (-e join_paths($target, $f))
623 15 73 if $self->should_skip_target_which_is_stow_dir($target)
633 0 73 unless -d $target
636 0 73 unless opendir my $DIR, $target
643 73 195 if $node eq '.'
644 73 122 if $node eq '..'
646 0 122 if $self->ignore($stow_path, $package, $node_target)
672 47 75 if ($self->is_a_link($target)) { }
74 1 elsif (-d $target) { }
1 0 elsif (-e $target) { }
677 0 47 unless ($existing_source)
684 14 33 unless ($existing_path)
692 32 1 if (-e $existing_path) { }
694 4 28 if ($existing_path eq $path) { }
1 27 elsif ($self->override($target)) { }
712 3 71 if (my $parent = $self->foldable($target))
747 1 45 if $self->should_skip_target_which_is_stow_dir($target)
755 0 45 unless -d $path
760 0 45 unless $self->is_a_node($target)
763 0 45 unless opendir my $DIR, $path
770 45 109 if $node eq '.'
771 45 64 if $node eq '..'
773 8 56 if $self->ignore($stow_path, $package, $node_target)
775 5 51 if ($self->{'dotfiles'})
783 45 0 if (-d $target)
809 27 29 if ($self->is_a_link($target)) { }
24 5 elsif (-e $target) { }
814 0 27 unless ($existing_source)
818 0 27 if ($existing_source =~ m[\A/])
826 1 26 unless ($existing_path)
836 25 1 if (-e $existing_path) { }
840 5 20 if ($self->{'dotfiles'})
844 22 3 if ($existing_path eq $path)
874 23 1 if (-d $target) { }
878 4 19 if (my $parent = $self->foldable($target))
950 2 497 if ($self->marked_stow_dir($dir))
952 0 2 if $i == $#path
964 0 126 if (substr($path, 0, 1) eq '/' xor substr($self->{'stow_path'}, 0, 1) eq '/')
974 37 201 if (shift @path ne shift @stow_path)
980 1 88 if (@stow_path)
1006 0 48 unless (-d $dir)
1010 0 48 unless opendir my $DIR, $dir
1017 48 263 if $node eq '.'
1018 48 215 if $node eq '..'
1022 65 150 if (-l $node_path and not exists $self->{'link_task_for'}{$node_path})
1027 0 65 unless ($source)
1031 1 64 if (not -e join_paths($dir, $source) and $self->path_owned_by_package($node_path, $source))
1059 6 95 if ($self->{'no-folding'})
1064 0 95 unless opendir my $DIR, $target
1073 50 130 if $node eq '.'
1074 50 80 if $node eq '..'
1079 9 71 unless $self->is_a_node($path)
1082 39 32 unless $self->is_a_link($path)
1086 0 32 unless ($source)
1089 25 7 if ($parent eq '') { }
7 0 elsif ($parent ne parent($source)) { }
1096 39 10 unless $parent
1106 8 2 if ($self->path_owned_by_package($target, $parent)) { }
1130 0 7 unless opendir my $DIR, $target
1137 7 16 if $node eq '.'
1138 7 9 if $node eq '..'
1139 2 7 unless $self->is_a_node(join_paths($target, $node))
1240 0 597 unless length $target
1244 4 46 if ($target =~ /$suffix/)
1253 591 0 defined $path_regexp ? :
1255 476 115 defined $segment_regexp ? :
1258 25 566 if (defined $path_regexp and "/$target" =~ /$path_regexp/)
1264 28 538 if (defined $segment_regexp and $basename =~ /$segment_regexp/)
1288 266 696 if (-e $file) { }
1307 244 22 if (exists $ignore_file_regexps{$file})
1312 0 22 unless (open REGEXPS, $file)
1337 18 3 if (exists $ignore_file_regexps{$file}) { }
1354 98 240 if /^#/ or length $_ == 0
1374 187 89 if (index($regexp, '/') < 0) { }
1386 27 9 @segment_regexps ? :
1388 35 0 @path_regexps ? :
1398 2 60 if $@
1424 3 5 if $path =~ /$prefix/
1442 2 4 if $path =~ /$regex/
1470 0 45 unless (@{$self->{'tasks'};})
1497 85 45 if ($task->{'action'} eq 'create') { }
43 2 elsif ($task->{'action'} eq 'remove') { }
2 0 elsif ($task->{'action'} eq 'move') { }
1498 19 66 if ($task->{'type'} eq 'dir') { }
66 0 elsif ($task->{'type'} eq 'link') { }
1499 0 19 unless mkdir $task->{'path'}, 511
1509 0 66 unless symlink $task->{'source'}, $task->{'path'}
1514 5 38 if ($task->{'type'} eq 'dir') { }
38 0 elsif ($task->{'type'} eq 'link') { }
1516 0 5 unless rmdir $task->{'path'}
1521 0 38 unless unlink $task->{'path'}
1526 2 0 if ($task->{'type'} eq 'file')
1530 0 2 unless move($task->{'path'}, $task->{'dest'})
1551 815 34 unless (exists $self->{'link_task_for'}{$path})
1557 0 34 unless $action eq 'remove' or $action eq 'create'
1576 370 30 unless (exists $self->{'dir_task_for'}{$path})
1582 0 30 unless $action eq 'remove' or $action eq 'create'
1606 9 830 if (exists $self->{'link_task_for'}{$prefix} and $self->{'link_task_for'}{$prefix}{'action'} eq 'remove')
1631 7 366 if (my $action = $self->link_task_action($path))
1632 0 7 if ($action eq 'remove') { }
7 0 elsif ($action eq 'create') { }
1642 119 247 if (-l $path)
1646 1 118 $self->parent_link_scheduled_for_removal($path) ? :
1668 0 50 if (my $action = $self->dir_task_action($path))
1669 0 0 if ($action eq 'remove') { }
0 0 elsif ($action eq 'create') { }
1677 0 50 if $self->parent_link_scheduled_for_removal($path)
1679 43 7 if (-d $path)
1706 17 333 if ($laction eq 'remove') { }
2 331 elsif ($laction eq 'create') { }
1707 0 17 if ($daction eq 'remove') { }
6 11 elsif ($daction eq 'create') { }
1722 2 0 if ($daction eq 'remove') { }
0 0 elsif ($daction eq 'create') { }
1738 0 331 if ($daction eq 'remove') { }
22 309 elsif ($daction eq 'create') { }
1749 8 301 if $self->parent_link_scheduled_for_removal($path)
1751 234 67 if (-e $path)
1773 7 118 if (my $action = $self->link_task_action($path)) { }
118 0 elsif (-l $path) { }
1776 7 0 if ($action eq 'create') { }
0 0 elsif ($action eq 'remove') { }
1787 0 118 unless my $target = readlink $path
1806 7 68 if (exists $self->{'dir_task_for'}{$newfile})
1809 0 7 if ($task_ref->{'action'} eq 'create') { }
7 0 elsif ($task_ref->{'action'} eq 'remove') { }
1810 0 0 if ($task_ref->{'type'} eq 'dir')
1826 2 73 if (exists $self->{'link_task_for'}{$newfile})
1829 0 2 if ($task_ref->{'action'} eq 'create') { }
2 0 elsif ($task_ref->{'action'} eq 'remove') { }
1830 0 0 if ($task_ref->{'source'} ne $oldfile) { }
1843 0 2 if ($task_ref->{'source'} eq $oldfile)
1883 7 41 if (exists $self->{'link_task_for'}{$file})
1885 0 7 if ($task_ref->{'action'} eq 'remove') { }
7 0 elsif ($task_ref->{'action'} eq 'create') { }
1901 0 41 if (exists $self->{'dir_task_for'}{$file} and $self->{'dir_task_for'}{$file} eq 'create')
1912 0 41 unless my $source = readlink $file
1940 3 16 if (exists $self->{'link_task_for'}{$dir})
1943 0 3 if ($task_ref->{'action'} eq 'create') { }
3 0 elsif ($task_ref->{'action'} eq 'remove') { }
1958 0 19 if (exists $self->{'dir_task_for'}{$dir})
1961 0 0 if ($task_ref->{'action'} eq 'create') { }
0 0 elsif ($task_ref->{'action'} eq 'remove') { }
2002 0 7 if (exists $self->{'link_task_for'}{$dir})
2012 0 7 if (exists $self->{'dir_task_for'}{$dir})
2015 0 0 if ($task_ref->{'action'} eq 'remove') { }
0 0 elsif ($task_ref->{'action'} eq 'create') { }
2056 0 2 if (exists $self->{'link_task_for'}{$src}) { }
0 2 elsif (exists $self->{'dir_task_for'}{$src}) { }