Revision history for Perl extension Cwd.
+2.14 Thu Jan 8 18:51:08 CST 2004
+
+ - We now use File::Spec->canonpath() and properly-escaped regular
+ expressions when comparing paths in the regression tests. This
+ fixes some testing failures in 2.13 on non-Unix platforms. No
+ changes were made in the actual Cwd module code. [Steve Hay]
+
2.13 Fri Jan 2 22:29:42 CST 2004
- Changed a '//' comment to a '/* */' comment in the XS code, so that
use File::Spec;
use File::Path;
-use Test::More tests => 16;
+use Test::More tests => 20;
my $IsVMS = $^O eq 'VMS';
my $IsMacOS = $^O eq 'MacOS';
my $Top_Test_Dir = '_ptrslt_';
my $Test_Dir = File::Spec->catdir($Top_Test_Dir, qw/_path_ _to_ _a_ _dir_/);
-my $want = File::Spec->catdir('t', $Test_Dir);
+my $want = quotemeta File::Spec->catdir('t', $Test_Dir);
mkpath([$Test_Dir], 0, 0777);
Cwd::chdir $Test_Dir;
-like(cwd(), qr|$want$|, 'chdir() + cwd()');
-like(getcwd(), qr|$want$|, ' + getcwd()');
-like(fastcwd(), qr|$want$|, ' + fastcwd()');
-like(fastgetcwd(), qr|$want$|, ' + fastgetcwd()');
+foreach my $func (qw(cwd getcwd fastcwd fastgetcwd)) {
+ my $result = eval "$func()";
+ is $@, '';
+ like( File::Spec->canonpath($result), qr|$want$|, "$func()" );
+}
# Cwd::chdir should also update $ENV{PWD}
-like($ENV{PWD}, qr|$want$|, 'Cwd::chdir() updates $ENV{PWD}');
+like(File::Spec->canonpath($ENV{PWD}), qr|$want$|, 'Cwd::chdir() updates $ENV{PWD}');
my $updir = File::Spec->updir;
Cwd::chdir $updir;
print "#$ENV{PWD}\n";