summaryrefslogtreecommitdiff
path: root/lib/File/Path.t
diff options
context:
space:
mode:
authorDavid Landgren <david@landgren.net>2007-06-07 01:57:34 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-06-07 08:01:18 +0000
commit3376a30ff58c3873904ed75bb471f95c5ecf3651 (patch)
tree45fdecb750e81de5909af7c88d6b7067045605cc /lib/File/Path.t
parent88c9158a91a1955a339ddf2df5c91907a15bef4c (diff)
downloadperl-3376a30ff58c3873904ed75bb471f95c5ecf3651.tar.gz
Re: [PATCH] Update File-Path to 2.00
Message-ID: <46672DCE.2080508@landgren.net> p4raw-id: //depot/perl@31345
Diffstat (limited to 'lib/File/Path.t')
-rwxr-xr-xlib/File/Path.t21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/File/Path.t b/lib/File/Path.t
index 055fc4640b..427ef250ce 100755
--- a/lib/File/Path.t
+++ b/lib/File/Path.t
@@ -2,7 +2,7 @@
use strict;
-use Test::More tests => 72;
+use Test::More tests => 71;
BEGIN {
use_ok('File::Path');
@@ -74,11 +74,7 @@ SKIP: {
my $count = rmtree({error => \$error});
is( $count, 0, 'rmtree of nothing, count of zero' );
-is( scalar(@$error), 1, 'one diagnostic captureed' );
-eval { ($file, $message) = each %{$error->[0]} }; # too early to die, just in case
-is( $@, '', 'decoded diagnostic' );
-is( $file, '', 'general diagnostic' );
-is( $message, 'No root path(s) specified', 'expected diagnostic received' );
+is( scalar(@$error), 0, 'no diagnostic captured' );
@created = mkpath($tmp_base, 0);
is(scalar(@created), 0, "skipped making existing directories (old style 1)")
@@ -220,10 +216,21 @@ SKIP: {
is( $file, $dir, 'symlink reported in error' );
}
+{
+ $dir = catdir($tmp_base, 'Z');
+ @created = mkpath($dir);
+ is(scalar(@created), 1, "create a Z directory");
+
+ local @ARGV = ($dir);
+ rmtree( [grep -e $_, @ARGV], 0, 0 );
+ ok(!-e $dir, "blow it away via \@ARGV");
+}
+
SKIP: {
skip 'Test::Output not available', 10
unless $has_Test_Output;
+
SKIP: {
$dir = catdir('EXTRA', '3');
skip "extra scenarios not set up, see eg/setup-extra-tests", 2
@@ -252,7 +259,7 @@ and can't restore permissions to \d+
$dir2 = catdir($base,'B');
stderr_like(
- sub { rmtree( [], 1 ) },
+ sub { rmtree( undef, 1 ) },
qr/\ANo root path\(s\) specified\b/,
"rmtree of nothing carps sensibly"
);