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