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