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