File Coverage

inc/File/Spec/Functions.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             #line 1
2             package File::Spec::Functions;
3 4     4   27  
  4         8  
  4         109  
4 4     4   20 use File::Spec;
  4         10  
  4         779  
5             use strict;
6              
7             our $VERSION = '3.75';
8             $VERSION =~ tr/_//d;
9              
10             require Exporter;
11              
12             our @ISA = qw(Exporter);
13              
14             our @EXPORT = qw(
15             canonpath
16             catdir
17             catfile
18             curdir
19             rootdir
20             updir
21             no_upwards
22             file_name_is_absolute
23             path
24             );
25              
26             our @EXPORT_OK = qw(
27             devnull
28             tmpdir
29             splitpath
30             splitdir
31             catpath
32             abs2rel
33             rel2abs
34             case_tolerant
35             );
36              
37             our %EXPORT_TAGS = ( ALL => [ @EXPORT_OK, @EXPORT ] );
38              
39             require File::Spec::Unix;
40             my %udeps = (
41             canonpath => [],
42             catdir => [qw(canonpath)],
43             catfile => [qw(canonpath catdir)],
44             case_tolerant => [],
45             curdir => [],
46             devnull => [],
47             rootdir => [],
48             updir => [],
49             );
50              
51             foreach my $meth (@EXPORT, @EXPORT_OK) {
52 4     4   29 my $sub = File::Spec->can($meth);
  4         10  
  4         753  
53             no strict 'refs';
54             if (exists($udeps{$meth}) && $sub == File::Spec::Unix->can($meth) &&
55             !(grep {
56             File::Spec->can($_) != File::Spec::Unix->can($_)
57             } @{$udeps{$meth}}) &&
58             defined(&{"File::Spec::Unix::_fn_$meth"})) {
59             *{$meth} = \&{"File::Spec::Unix::_fn_$meth"};
60 135     135   8082 } else {
        135      
61             *{$meth} = sub {&$sub('File::Spec', @_)};
62             }
63             }
64              
65              
66             1;
67             __END__