Fix when( scalar ... ) bug
[p5sagit/p5-mst-13.2.git] / cpan / Cwd / t / win32.t
1 #!./perl
2
3 use File::Spec;
4 use lib File::Spec->catdir('t', 'lib');
5 use Test::More;
6
7 if( $^O eq 'MSWin32' ) {
8   plan tests => 4;
9 } else {
10   plan skip_all => 'this is not win32';
11 }
12
13 use Cwd;
14 ok 1;
15
16 my $cdir = getdcwd('C:');
17 like $cdir, qr{^C:}i;
18
19 my $ddir = getdcwd('D:');
20 if (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' =~ /(.*)/;
30 my $result = File::Spec::Win32->catfile('C:/cache', $1);
31 is( $result, 'C:\cache\Foo\strawberry' );
32