summaryrefslogtreecommitdiff
path: root/lib/File/Find
diff options
context:
space:
mode:
authorBram <perl-rt@wizbit.be>2008-05-13 00:13:33 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-05-23 06:18:59 +0000
commit68c65ec0adda9d2b3fc21f30f68be0ef10de5ad8 (patch)
tree38704ec666d69df031c83ad2dfecf77f6cbe4db5 /lib/File/Find
parent93c512172a58c199c03358764753a650e33707e2 (diff)
downloadperl-68c65ec0adda9d2b3fc21f30f68be0ef10de5ad8.tar.gz
Re: [perl #41555] Bug in File::Find on Windows when target
Message-ID: <20080512221333.mq0283dlessws4wk@horde.wizbit.be> p4raw-id: //depot/perl@33911
Diffstat (limited to 'lib/File/Find')
-rw-r--r--lib/File/Find/t/find.t67
1 files changed, 65 insertions, 2 deletions
diff --git a/lib/File/Find/t/find.t b/lib/File/Find/t/find.t
index 60834bd977..6a71f98cb0 100644
--- a/lib/File/Find/t/find.t
+++ b/lib/File/Find/t/find.t
@@ -18,8 +18,14 @@ BEGIN {
$SIG{'__WARN__'} = sub { $warn_msg = $_[0]; warn "# $_[0]"; }
}
-if ( $symlink_exists ) { print "1..199\n"; }
-else { print "1..85\n"; }
+my $test_count = 85;
+$test_count += 114 if $symlink_exists;
+$test_count += 18 if $^O eq 'MSWin32';
+$test_count += 2 if $^O eq 'MSWin32' and $symlink_exists;
+
+print "1..$test_count\n";
+#if ( $symlink_exists ) { print "1..199\n"; }
+#else { print "1..85\n"; }
my $orig_dir = cwd();
@@ -830,3 +836,60 @@ if ( $symlink_exists ) {
unlink file_path('fa', 'faa_sl');
}
+
+
+# Win32 checks - [perl #41555]
+if ($^O eq 'MSWin32') {
+ require File::Spec::Win32;
+ my ($volume) = File::Spec::Win32->splitpath($orig_dir, 1);
+ print STDERR "VOLUME = $volume\n";
+
+ # with chdir
+ %Expect_File = (File::Spec->curdir => 1,
+ file_path('fsl') => 1,
+ file_path('fa_ord') => 1,
+ file_path('fab') => 1,
+ file_path('fab_ord') => 1,
+ file_path('faba') => 1,
+ file_path('faba_ord') => 1,
+ file_path('faa') => 1,
+ file_path('faa_ord') => 1);
+
+ delete $Expect_File{ file_path('fsl') } unless $symlink_exists;
+ %Expect_Name = ();
+
+ %Expect_Dir = (dir_path('fa') => 1,
+ dir_path('faa') => 1,
+ dir_path('fab') => 1,
+ dir_path('faba') => 1,
+ dir_path('fb') => 1,
+ dir_path('fba') => 1);
+
+
+
+ File::Find::find( {wanted => \&wanted_File_Dir}, topdir('fa'));
+ Check( scalar(keys %Expect_File) == 0 );
+
+ # no_chdir
+ %Expect_File = ($volume . file_path_name('fa') => 1,
+ $volume . file_path_name('fa', 'fsl') => 1,
+ $volume . file_path_name('fa', 'fa_ord') => 1,
+ $volume . file_path_name('fa', 'fab') => 1,
+ $volume . file_path_name('fa', 'fab', 'fab_ord') => 1,
+ $volume . file_path_name('fa', 'fab', 'faba') => 1,
+ $volume . file_path_name('fa', 'fab', 'faba', 'faba_ord') => 1,
+ $volume . file_path_name('fa', 'faa') => 1,
+ $volume . file_path_name('fa', 'faa', 'faa_ord') => 1);
+
+
+ delete $Expect_File{ $volume . file_path_name('fa', 'fsl') } unless $symlink_exists;
+ %Expect_Name = ();
+
+ %Expect_Dir = ($volume . dir_path('fa') => 1,
+ $volume . dir_path('fa', 'faa') => 1,
+ $volume . dir_path('fa', 'fab') => 1,
+ $volume . dir_path('fa', 'fab', 'faba') => 1);
+
+ File::Find::find( {wanted => \&wanted_File_Dir, no_chdir => 1}, $volume . topdir('fa'));
+ Check( scalar(keys %Expect_File) == 0 );
+}