From: Rafael Garcia-Suarez Date: Sun, 11 Jan 2004 22:38:08 +0000 (+0000) Subject: Upgrade to Cwd 2.14. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad78113d988ec1b364801653dfe48de85db425e6;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Cwd 2.14. p4raw-id: //depot/perl@22112 --- diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes index c117944..3062ca1 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 394b4b5..7256456 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 9ad42e7..dca0a2f 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 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);