Commit | Line | Data |
83a611dd |
1 | use strict; |
2 | use Test; |
3 | use Win32; |
4 | |
5 | plan tests => 16; |
6 | |
7 | my $cwd = Win32::GetCwd; |
8 | my @cwd = split/\\/, $cwd; |
9 | my $file = pop @cwd; |
10 | my $dir = join('\\', @cwd); |
11 | |
12 | ok(scalar Win32::GetFullPathName('.'), $cwd); |
13 | ok((Win32::GetFullPathName('.'))[0], "$dir\\"); |
14 | ok((Win32::GetFullPathName('.'))[1], $file); |
15 | |
16 | ok((Win32::GetFullPathName('./'))[0], "$cwd\\"); |
17 | ok((Win32::GetFullPathName('.\\'))[0], "$cwd\\"); |
18 | ok((Win32::GetFullPathName('./'))[1], ""); |
19 | |
20 | ok(scalar Win32::GetFullPathName($cwd), $cwd); |
21 | ok((Win32::GetFullPathName($cwd))[0], "$dir\\"); |
22 | ok((Win32::GetFullPathName($cwd))[1], $file); |
23 | |
24 | ok(scalar Win32::GetFullPathName(substr($cwd,2)), $cwd); |
25 | ok((Win32::GetFullPathName(substr($cwd,2)))[0], "$dir\\"); |
26 | ok((Win32::GetFullPathName(substr($cwd,2)))[1], $file); |
27 | |
28 | ok(scalar Win32::GetFullPathName('/Foo Bar/'), substr($cwd,0,2)."\\Foo Bar\\"); |
29 | |
30 | chdir($dir); |
31 | ok(scalar Win32::GetFullPathName('.'), $dir); |
32 | |
33 | ok((Win32::GetFullPathName($file))[0], "$dir\\"); |
34 | ok((Win32::GetFullPathName($file))[1], $file); |