blib/lib/File/Spec/Functions.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran 100% 2 / 2 Conditioncond 66.6% 6 / 9 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 84.0% 42 / 50 CC 1 SCAR 0.1
CC
1
Cov
90%
__ANON__
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/File/Spec.pm ↑ Summary Cwd.xs »
1 package File::Spec::Functions;
2  
3 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '3.75';
7 1 $VERSION =~ tr/_//d;
8  
9 1 require Exporter;
10  
11 1 our @ISA = qw(Exporter);
12  
13 1 our @EXPORT = qw(
14 canonpath
15 catdir
16 catfile
17 curdir
18 rootdir
19 updir
20 no_upwards
21 file_name_is_absolute
22 path
23 );
24  
25 1 our @EXPORT_OK = qw(
26 devnull
27 tmpdir
28 splitpath
29 splitdir
30 catpath
31 abs2rel
32 rel2abs
33 case_tolerant
34 );
35  
36 1 our %EXPORT_TAGS = ( ALL => [ @EXPORT_OK, @EXPORT ] );
37  
38 1 require File::Spec::Unix;
39 1 my %udeps = (
40 canonpath => [],
41 catdir => [qw(canonpath)],
42 catfile => [qw(canonpath catdir)],
43 case_tolerant => [],
44 curdir => [],
45 devnull => [],
46 rootdir => [],
47 updir => [],
48 );
49  
50 1 foreach my $meth (@EXPORT, @EXPORT_OK) {
51 17 my $sub = File::Spec->can($meth);
52 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
53 17 ▶ if (exists($udeps{$meth}) && $sub == File::Spec::Unix->can($meth) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $udeps{$meth} and $sub == 'File::Spec::Unix'->can($meth) and not grep({'File::Spec'->can($_) != 'File::Spec::Unix'->can($_);} @{$udeps{$meth};}) and defined &{"File::Spec::Unix::_fn_$meth";}) { } 8 9 17
Condition66%6/9
exists $udeps{$meth} and $sub == "File::Spec::Unix"->can($meth) and not grep({"File::Spec"->can($_) != "File::Spec::Unix"->can($_);} @{$udeps{$meth};}) and defined &{"File::Spec::Unix::_fn_$meth";}
!ll&&!rl&&r
908
exists $udeps{$meth} and $sub == "File::Spec::Unix"->can($meth) and not grep({"File::Spec"->can($_) != "File::Spec::Unix"->can($_);} @{$udeps{$meth};})
!ll&&!rl&&r
908
exists $udeps{$meth} and $sub == "File::Spec::Unix"->can($meth)
!ll&&!rl&&r
908
MC/DC25%1/4
exists $udeps{$meth} and $sub == "File::Spec::Unix"->can($meth) and not grep({"File::Spec"->can($_) != "File::Spec::Unix"->can($_);} @{$udeps{$meth};}) and defined &{"File::Spec::Unix::_fn_$meth";}
exists $udeps{$meth} $sub == "File::Spec::Unix"->can($meth) not grep({"File::Spec"->can($_) != "File::Spec::Unix"->can($_);} @{$udeps{$meth};}) defined &{"File::Spec::Unix::_fn_$meth";}
Truth table40%2/5
A and B and not(C) and D
A= exists $udeps{$meth}B= $sub == "File::Spec::Unix"->can($meth)C= not grep({"File::Spec"->can($_) != "File::Spec::Unix"->can($_);} @{$udeps{$meth};})D= defined &{"File::Spec::Unix::_fn_$meth";}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
54 !(grep {
55 3 File::Spec->can($_) != File::Spec::Unix->can($_)
56 8 } @{$udeps{$meth}}) &&
57 8 defined(&{"File::Spec::Unix::_fn_$meth"})) {
58 8 *{$meth} = \&{"File::Spec::Unix::_fn_$meth"};
59 } else {
60 0 ▶ *{$meth} = sub {&$sub('File::Spec', @_)};
Subroutine __ANON__: not called CC=1 SCAR=0.4
61 }
62 }
63  
64  
65 1 1;
66 __END__
« blib/lib/File/Spec.pm ↑ Summary Cwd.xs »