Branch Coverage

blib/lib/NVMPL/Switcher.pm
Criterion Covered Total %
branch 23 64 35.9


line true false branch
15 0 1 if ($^O eq "MSWin32")
17 0 0 if ($ENV{'PSModulePath'}) { }
0 0 elsif ($ENV{'ComSpec'} and $ENV{'ComSpec'} =~ /cmd\.exe/i) { }
28 0 1 if ($shell =~ /zsh/i) { }
0 1 elsif ($shell =~ /bash/i) { }
39 0 2 unless ($version)
53 0 2 if ($^O eq "MSWin32")
55 0 0 if (@matches and -d $matches[0])
62 1 1 unless (-d $target_dir)
67 0 1 if (-l $current_link or -d $current_link)
68 0 0 unless unlink $current_link
71 0 1 if ($^O =~ /MSWin/) { }
74 0 1 unless symlink $target_dir, $current_link
83 0 0 if ($^O eq "MSWin32" and $ENV{'PSModulePath'})
89 0 0 if (not $node_check =~ /\Q$ps_path\E/i) { }
93 0 0 unless ($ps_exe)
98 0 0 if ($ps_exe) { }
121 0 1 unless (eval "require $shell_module")
145 0 1 unless $config_file
149 1 0 if (-f $config_file)
150 0 1 unless open my $in, "<", $config_file
161 0 99 if ($line =~ /^# nvm-pl managed Node\.js path$/)
167 0 99 if ($in_nvm_section)
168 0 0 if ($line =~ /^\s*$/ or $line =~ /^#/) { }
175 99 0 unless $in_nvm_section
179 0 1 unless open my $out, ">", $config_file
197 0 0 unless system($cmd) == 0
205 0 1 unless opendir my $dh, $versions_dir
206 2 2 if /^v\d/
209 1 0 if (@dirs) { }
220 0 1 if (-l $current) { }
231 0 0 if (-l $current)