lib/App/Perlbrew/Patchperl.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 4 / 4 Conditioncond 83.3% 5 / 6 MC/DCmcdc 75.0% 3 / 4 Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 3 totaltotal 91.3% 53 / 58 CC 5 SCAR 5.4
CC
5
Cov
98%
maybe_patchperl_in_app_root
3.0
maybe_patchperl
2.0
maybe_patchperl_in_system
2.0
CRAP 1.7
« lib/App/Perlbrew/Path/Installations.pm ↑ Summary lib/App/Perlbrew/Path/Root.pm »
1 package App::Perlbrew::Patchperl;
2 69 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 69 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 69 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 69 ▶use App::Perlbrew::Path::Root;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 69 ▶use Capture::Tiny qw(capture);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 69 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 69 our @EXPORT_OK = qw(maybe_patchperl);
11  
12 9 ▶sub maybe_patchperl {
Subroutine maybe_patchperl: called CC=2 SCAR=6.9
Pod undocumented
13 9 my App::Perlbrew::Path::Root $perlbrew_root = shift;
14 return (
15 9 ▶ maybe_patchperl_in_app_root($perlbrew_root) ||
Condition100%3/3
maybe_patchperl_in_app_root($perlbrew_root) || maybe_patchperl_in_system()
l!l&&r!l&&!r
252
MC/DC100%2/2
maybe_patchperl_in_app_root($perlbrew_root) || maybe_patchperl_in_system()
maybe_patchperl_in_app_root($perlbrew_root) maybe_patchperl_in_system()
Truth table100%3/3
A || B
A= maybe_patchperl_in_app_root($perlbrew_root)B= maybe_patchperl_in_system()
ABresult
1X1
011
000
16 maybe_patchperl_in_system()
17 );
18 }
19  
20 9 ▶sub maybe_patchperl_in_app_root {
Subroutine maybe_patchperl_in_app_root: called CC=3 SCAR=11.0
Pod undocumented
21 9 my App::Perlbrew::Path::Root $perlbrew_root = shift;
22 9 my $patchperl = $perlbrew_root->bin("patchperl");
23  
24 9 ▶ if (-x $patchperl && -f _) {
Branch: 1 branch
BranchTrueFalseTotal
if (-x $patchperl and -f _) { } 2 7 9
Condition66%2/3
-x $patchperl and -f _
!ll&&!rl&&r
702
MC/DC50%1/2
-x $patchperl and -f _
-x $patchperl -f _
Truth table66%2/3
A and B
A= -x $patchperlB= -f _
ABresult
0X0
100
111
25 2 return $patchperl;
26 } else {
27 7 return undef;
28 }
29 }
30  
31 7 ▶sub maybe_patchperl_in_system {
Subroutine maybe_patchperl_in_system: called CC=2 SCAR=6.9
Pod undocumented
32 7 ▶ my (undef, undef, $exit_status) = capture {
Subroutine __ANON__: called CC=1 SCAR=0.0
33 7 system("patchperl --version");
34 7 };
35  
36 7 ▶ if ($exit_status == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($exit_status == 0) { } 5 2 7
37 5 return "patchperl"
38 } else {
39 2 return undef;
40 }
41 }
42  
43 69 1;
« lib/App/Perlbrew/Path/Installations.pm ↑ Summary lib/App/Perlbrew/Path/Root.pm »