summaryrefslogtreecommitdiff
path: root/lib/File/Path.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-12-04 14:09:20 +0000
committerNicholas Clark <nick@ccl4.org>2008-12-04 14:09:20 +0000
commitaa119509815264ca46da9f8ef37082ad657bdb94 (patch)
tree1b7e0d40a8a4e37361a2d07a21b716fb91cec16b /lib/File/Path.t
parent210707008b520f8aa498d2091080e67662d4b270 (diff)
downloadperl-aa119509815264ca46da9f8ef37082ad657bdb94.tar.gz
For now, remove the 'cannot remove [dir] when cwd is [dir]' message,
because the existing code will think that /tmp/abc is a subdirectory of /tmp/aa, and whilst we have a patch for Win32 and *nix, we've not tested on VMS, which has "interesting" path syntax. p4raw-id: //depot/perl@35009
Diffstat (limited to 'lib/File/Path.t')
-rwxr-xr-xlib/File/Path.t39
1 files changed, 1 insertions, 38 deletions
diff --git a/lib/File/Path.t b/lib/File/Path.t
index 34e316e67d..ca9eaf6f8f 100755
--- a/lib/File/Path.t
+++ b/lib/File/Path.t
@@ -2,7 +2,7 @@
use strict;
-use Test::More tests => 114;
+use Test::More tests => 108;
use Config;
BEGIN {
@@ -138,43 +138,6 @@ sub count {
rmtree 'solo';
}
-SKIP: {
- # tests for rmtree() of ancestor directory
- my $nr_tests = 6;
- my $cwd = getcwd() or skip "failed to getcwd: $!", $nr_tests;
- my $dir = catdir($cwd, 'remove');
- my $dir2 = catdir($cwd, 'remove', 'this', 'dir');
-
- skip "failed to mkpath '$dir2': $!", $nr_tests
- unless mkpath($dir2, {verbose => 0});
- skip "failed to chdir dir '$dir2': $!", $nr_tests
- unless chdir($dir2);
-
- rmtree($dir, {error => \$error});
- my $nr_err = @$error;
- is($nr_err, 1, "ancestor error");
-
- if ($nr_err) {
- my ($file, $message) = each %{$error->[0]};
- is($file, $dir, "ancestor named");
- my $ortho_dir = $^O eq 'MSWin32' ? File::Path::_slash_lc($dir2) : $dir2;
- $^O eq 'MSWin32' and $message
- =~ s/\A(cannot remove path when cwd is )(.*)\Z/$1 . File::Path::_slash_lc($2)/e;
- is($message, "cannot remove path when cwd is $ortho_dir", "ancestor reason");
- ok(-d $dir2, "child not removed");
- ok(-d $dir, "ancestor not removed");
- }
- else {
- fail( "ancestor 1");
- fail( "ancestor 2");
- fail( "ancestor 3");
- fail( "ancestor 4");
- }
- chdir $cwd;
- rmtree($dir);
- ok(!(-d $dir), "ancestor now removed");
-};
-
my $count = rmtree({error => \$error});
is( $count, 0, 'rmtree of nothing, count of zero' );
is( scalar(@$error), 0, 'no diagnostic captured' );