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