Re: [PATCH-revised] ext/Win32/t/Unicode.t failures on FAT32 under Cygwin
[p5sagit/p5-mst-13.2.git] / ext / Win32 / t / GetLongPathName.t
CommitLineData
83a611dd 1use strict;
2use Test;
3use Win32;
bb27e7b6 4
5my @paths = qw(
6 /
7 //
8 .
9 ..
10 c:
11 c:/
12 c:./
13 c:/.
14 c:/..
15 c:./..
16 //./
17 //.
18 //..
19 //./..
20);
21push @paths, map { my $x = $_; $x =~ s,/,\\,g; $x } @paths;
22push @paths, qw(
23 ../\
24 c:.\\../\
25 c:/\..//
26 c://.\/./\
27 \\.\\../\
28 //\..//
29 //.\/./\
30);
31
32my $drive = $ENV{SystemDrive};
33if ($drive) {
34 for (@paths) {
35 s/^c:/$drive/;
36 }
37 push @paths, $ENV{SystemRoot} if $ENV{SystemRoot};
38}
39my %expect;
40@expect{@paths} = map { my $x = $_; $x =~ s,(.[/\\])[/\\]+,$1,g; $x } @paths;
41
83a611dd 42plan tests => scalar(@paths);
43
bb27e7b6 44my $i = 1;
45for (@paths) {
46 my $got = Win32::GetLongPathName($_);
47 print "# '$_' => expect '$expect{$_}' => got '$got'\n";
48 print "not " unless $expect{$_} eq $got;
49 print "ok $i\n";
50 ++$i;
51}