This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Cwd 2.14.
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 11 Jan 2004 22:38:08 +0000 (22:38 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 11 Jan 2004 22:38:08 +0000 (22:38 +0000)
p4raw-id: //depot/perl@22112

ext/Cwd/Changes
ext/Cwd/t/cwd.t
lib/Cwd.pm

index c117944..3062ca1 100644 (file)
@@ -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
index 394b4b5..7256456 100644 (file)
@@ -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";
index 9ad42e7..dca0a2f 100644 (file)
@@ -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);