Commit | Line | Data |
275e8705 |
1 | #!./perl |
2 | |
99f36a73 |
3 | use File::Spec; |
4 | use lib File::Spec->catdir('t', 'lib'); |
275e8705 |
5 | use Test::More; |
99f36a73 |
6 | |
275e8705 |
7 | if( $^O eq 'MSWin32' ) { |
486bcc50 |
8 | plan tests => 4; |
275e8705 |
9 | } else { |
10 | plan skip_all => 'this is not win32'; |
11 | } |
12 | |
13 | use Cwd; |
14 | ok 1; |
15 | |
16 | my $cdir = getdcwd('C:'); |
99f36a73 |
17 | like $cdir, qr{^C:}i; |
275e8705 |
18 | |
19 | my $ddir = getdcwd('D:'); |
20 | if (defined $ddir) { |
99f36a73 |
21 | like $ddir, qr{^D:}i; |
275e8705 |
22 | } else { |
23 | # May not have a D: drive mounted |
24 | ok 1; |
25 | } |
486bcc50 |
26 | |
27 | # Ensure compatibility with naughty versions of Template::Toolkit, |
28 | # which pass in a bare $1 as an argument |
29 | 'Foo/strawberry' =~ /(.*)/; |
30 | my $result = File::Spec::Win32->catfile('C:/cache', $1); |
31 | is( $result, 'C:\cache\Foo\strawberry' ); |
32 | |