File Coverage

t/PerlySense-Util-normalize-file-name.t
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 30 30 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   142167 use strict;
  1         1  
  1         63  
3              
4 1     1   506 use Test::More tests => 4;
  1         14546  
  1         6  
5 1     1   682 use Test::Exception;
  1         2582  
  1         4  
6              
7 1     1   453 use Path::Class;
  1         30698  
  1         46  
8              
9              
10 1     1   280 use lib "lib";
  1         551  
  1         4  
11              
12 1     1   81998 use_ok("Devel::PerlySense::Util");
  1         365  
  1         1  
  1         1  
  1         41  
13              
14              
15 1         262 is(filePathNormalize("sample.txt"), "sample.txt", "Simple file name");
16              
17 1         198 is(
18             filePathNormalize(file("dir", "sample.txt")),
19             file("dir", "sample.txt") . "",
20             "Simple file name",
21             );
22              
23              
24             #This is a hopeless thing to test cross platform, because the Unix
25             #version is "broken", in that realpath doesn't remove ../ properly,
26             #but the Win32 thing does.
27             #
28             #And nowhere is the path separator exposed.
29             #
30             #By using the same test code as implementation code, at least it
31             #should be bug compatible across platforms. Win32 doesn't need
32             #testing, because it's not broken. Unix will test the thing properly.
33 1         196 my $file = file("dir", "remove", "..", "sample.txt");
34 1         64 is(
35             filePathNormalize($file),
36             file("dir", "sample.txt") . "",
37             "Simple file name",
38             );
39              
40              
41              
42              
43             __END__