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
#!./perl
-use Cwd;
BEGIN {
chdir 't' if -d 't';
+ if ($ENV{PERL_CORE}) {
+ unshift @INC, '../lib';
+ }
}
+use Cwd;
use Config;
use strict;
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';
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");
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.
package Cwd;
-$VERSION = $VERSION = '2.17_03';
+$VERSION = $VERSION = '2.18';
=head1 NAME
Originally by the perl5-porters.
-Now maintained by Ken Williams <KWILLIAMS@cpan.org>
+Maintained by Ken Williams <KWILLIAMS@cpan.org>
=head1 SEE ALSO