if ($Is_MacOS) {
$dir_pref= ($p_dir =~ /:$/) ? $p_dir : "$p_dir:"; # preface
} elsif ($^O eq 'MSWin32') {
- $dir_pref = ($p_dir =~ m|\w:/$| ? $p_dir : "$p_dir/" );
+ $dir_pref = ($p_dir =~ m|\w:/?$| ? $p_dir : "$p_dir/" );
} elsif ($^O eq 'VMS') {
# VMS is returning trailing .dir on directories
$dir_pref = "$dir_name:";
}
elsif ($^O eq 'MSWin32') {
- $dir_name = ($p_dir =~ m|\w:/$| ? "$p_dir$dir_rel" : "$p_dir/$dir_rel");
+ $dir_name = ($p_dir =~ m|\w:/?$| ? "$p_dir$dir_rel" : "$p_dir/$dir_rel");
$dir_pref = "$dir_name/";
}
elsif ($^O eq 'VMS') {
$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();
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 );
+}