summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/Cwd/Changes7
-rw-r--r--ext/Cwd/t/cwd.t15
-rw-r--r--lib/Cwd.pm5
3 files changed, 17 insertions, 10 deletions
diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes
index c117944921..3062ca1074 100644
--- a/ext/Cwd/Changes
+++ b/ext/Cwd/Changes
@@ -1,5 +1,12 @@
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
diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t
index 394b4b56e4..7256456e98 100644
--- a/ext/Cwd/t/cwd.t
+++ b/ext/Cwd/t/cwd.t
@@ -11,7 +11,7 @@ use warnings;
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';
@@ -91,18 +91,19 @@ SKIP: {
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";
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index 9ad42e77e5..dca0a2f047 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -1,4 +1,5 @@
package Cwd;
+$VERSION = $VERSION = '2.14';
=head1 NAME
@@ -137,9 +138,7 @@ L<File::chdir>
use strict;
use Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-
-$VERSION = '2.13';
+use vars qw(@ISA @EXPORT @EXPORT_OK);
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);