File Coverage

lib/Perlmazing/Perlmazing/splitdir.pm
Criterion Covered Total %
statement 9 9 100.0
branch 3 4 75.0
condition 5 9 55.5
subroutine 2 2 100.0
pod 0 1 0.0
total 19 25 76.0


line stmt bran cond sub pod time code
1 1     1   13 use File::Spec ();
  1         2  
  1         309  
2             require File::Spec::Win32;
3              
4             sub main {
5 16     16 0 9011 my $path = shift;
6             # A little hack is needed for UNC paths under File::Spec
7 16 100       56 my $is_unc = $path =~ /^\\\\/ ? 1 : 0;
8 16         53 my @items = File::Spec::Win32->splitdir($path);
9 16 50 66     300 if ($is_unc and @items >= 3 and length($items[0]) == 0 and length($items[1]) == 0) {
      66        
      33        
10 10         44 @items = ('\\\\'.$items[2], @items[3..$#items]);
11             }
12 16         82 @items;
13             }
14              
15             1;