diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-03-09 15:27:38 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-03-09 15:27:38 +0000 |
commit | 821bf9a5d89e1fc44be0165540e1f57de5c874e1 (patch) | |
tree | cb5314d12d2106191a2535f288cffc1c22782754 /ext | |
parent | e70cb7eb5b13114b416be5e89ab15a7c16b720cf (diff) | |
download | perl-821bf9a5d89e1fc44be0165540e1f57de5c874e1.tar.gz |
Upgrade to Cwd 2.16
p4raw-id: //depot/perl@22470
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Cwd/Changes | 6 | ||||
-rw-r--r-- | ext/Cwd/t/cwd.t | 29 |
2 files changed, 13 insertions, 22 deletions
diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes index 01d20ede3c..c3158baeac 100644 --- a/ext/Cwd/Changes +++ b/ext/Cwd/Changes @@ -1,5 +1,11 @@ Revision history for Perl extension Cwd. +2.16 Sat Mar 6 17:56:31 CST 2004 + + - For VMS compatibility (and to conform to Cwd's documented + interface), in the regression tests we now compare output results + to an absolute path. [Craig A. Berry] + 2.15 Fri Jan 16 08:09:44 CST 2004 - Fixed a problem on static perl builds - while creating diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t index 3644833623..fbd8133cd9 100644 --- a/ext/Cwd/t/cwd.t +++ b/ext/Cwd/t/cwd.t @@ -89,8 +89,9 @@ SKIP: { } } -my @test_dirs = qw{_ptrslt_ _path_ _to_ _a_ _dir_}; -my $Test_Dir = File::Spec->catdir(@test_dirs); +my $Top_Test_Dir = '_ptrslt_'; +my $Test_Dir = File::Spec->catdir($Top_Test_Dir, qw/_path_ _to_ _a_ _dir_/); +my $want = quotemeta File::Spec->rel2abs($Test_Dir); mkpath([$Test_Dir], 0, 0777); Cwd::chdir $Test_Dir; @@ -98,11 +99,11 @@ Cwd::chdir $Test_Dir; foreach my $func (qw(cwd getcwd fastcwd fastgetcwd)) { my $result = eval "$func()"; is $@, ''; - dir_ends_with( $result, $Test_Dir, "$func()" ); + like( File::Spec->canonpath($result), qr|$want$|i, "$func()" ); } # Cwd::chdir should also update $ENV{PWD} -dir_ends_with( $ENV{PWD}, $Test_Dir, 'Cwd::chdir() updates $ENV{PWD}' ); +like(File::Spec->canonpath($ENV{PWD}), qr|$want$|i, 'Cwd::chdir() updates $ENV{PWD}'); my $updir = File::Spec->updir; Cwd::chdir $updir; print "#$ENV{PWD}\n"; @@ -115,7 +116,7 @@ print "#$ENV{PWD}\n"; Cwd::chdir $updir; print "#$ENV{PWD}\n"; -rmtree($test_dirs[0], 0, 0); +rmtree([$Top_Test_Dir], 0, 0); { my $check = ($IsVMS ? qr|\b((?i)t)\]$| : @@ -138,22 +139,6 @@ SKIP: { like($abs_path, qr|$want$|); like($fast_abs_path, qr|$want$|); - rmtree($test_dirs[0], 0, 0); + rmtree([$Top_Test_Dir], 0, 0); unlink "linktest"; } - -############################################# -# These two routines give us sort of a poor-man's cross-platform -# directory comparison routine. - -sub bracketed_form { - return join '', map "[$_]", - grep length, File::Spec->splitdir(File::Spec->canonpath( shift() )); -} - -sub dir_ends_with { - my ($dir, $expect) = (shift, shift); - my $bracketed_expect = quotemeta bracketed_form($expect); - like( bracketed_form($dir), qr|$bracketed_expect$|i, (@_ ? shift : ()) ); -} - |