From: Rafael Garcia-Suarez Date: Thu, 24 Jun 2004 16:47:24 +0000 (+0000) Subject: Upgrade to Cwd 2.18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7832186692f2b5bb0ae5b8a911736baf4ab3ff87;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Cwd 2.18 (with local changes to cwd.t, to adapt it to the core) p4raw-id: //depot/perl@22991 --- diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes index 12e14e7..68d85ca 100644 --- a/ext/Cwd/Changes +++ b/ext/Cwd/Changes @@ -1,6 +1,6 @@ Revision history for Perl extension Cwd. -2.18 (pending, still in beta release) +2.18 Thu Jun 24 08:22:57 CDT 2004 - Fixed a problem in which abs_path($arg) on some platforms could only be called on directories, and died when called on files. This diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t index c2142e9..951126f 100644 --- a/ext/Cwd/t/cwd.t +++ b/ext/Cwd/t/cwd.t @@ -1,9 +1,12 @@ #!./perl -use Cwd; BEGIN { chdir 't' if -d 't'; + if ($ENV{PERL_CORE}) { + unshift @INC, '../lib'; + } } +use Cwd; use Config; use strict; @@ -11,7 +14,7 @@ use warnings; use File::Spec; use File::Path; -use Test::More tests => 20; +use Test::More tests => 24; my $IsVMS = $^O eq 'VMS'; my $IsMacOS = $^O eq 'MacOS'; @@ -129,7 +132,7 @@ SKIP: { skip "no symlinks on this platform", 2 unless $Config{d_symlink}; mkpath([$Test_Dir], 0, 0777); - symlink $Test_Dir => "linktest"; + symlink $Test_Dir, "linktest"; my $abs_path = Cwd::abs_path("linktest"); my $fast_abs_path = Cwd::fast_abs_path("linktest"); @@ -142,6 +145,18 @@ SKIP: { unlink "linktest"; } +chdir '../ext/Cwd/t' if $ENV{PERL_CORE}; + +# Make sure we can run abs_path() on files, not just directories +my $path = 'cwd.t'; +dir_ends_with(Cwd::abs_path($path), 'cwd.t', 'abs_path() can be invoked on a file'); +dir_ends_with(Cwd::fast_abs_path($path), 'cwd.t', 'fast_abs_path() can be invoked on a file'); + +$path = File::Spec->catfile(File::Spec->updir, 't', $path); +dir_ends_with(Cwd::abs_path($path), 'cwd.t', 'abs_path() can be invoked on a file'); +dir_ends_with(Cwd::fast_abs_path($path), 'cwd.t', 'fast_abs_path() can be invoked on a file'); + + ############################################# # These two routines give us sort of a poor-man's cross-platform # directory comparison routine. diff --git a/lib/Cwd.pm b/lib/Cwd.pm index e7d12e3..af0c47f 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -1,5 +1,5 @@ package Cwd; -$VERSION = $VERSION = '2.17_03'; +$VERSION = $VERSION = '2.18'; =head1 NAME @@ -146,7 +146,7 @@ C. Originally by the perl5-porters. -Now maintained by Ken Williams +Maintained by Ken Williams =head1 SEE ALSO