This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Grab the second half of r10084 for cwd.t, which wasn't in change 33042.
[perl5.git] / ext / Cwd / t / cwd.t
index 3be500a..7d5f67f 100644 (file)
@@ -163,23 +163,20 @@ rmtree($test_dirs[0], 0, 0);
 SKIP: {
     skip "no symlinks on this platform", 2+$EXTRA_ABSPATH_TESTS unless $Config{d_symlink};
 
+    my $file = "linktest";
     mkpath([$Test_Dir], 0, 0777);
-    symlink $Test_Dir, "linktest";
+    symlink $Test_Dir, $file;
 
-    my $abs_path      =  Cwd::abs_path("linktest");
-    my $fast_abs_path =  Cwd::fast_abs_path("linktest");
-    my $want          =  quotemeta(
-                             File::Spec->rel2abs(
-                                $ENV{PERL_CORE} ? $Test_Dir : File::Spec->catdir('t', $Test_Dir)
-                                                )
-                                  );
+    my $abs_path      =  Cwd::abs_path($file);
+    my $fast_abs_path =  Cwd::fast_abs_path($file);
+    my $want          =  quotemeta( File::Spec->rel2abs($Test_Dir) );
 
     like($abs_path,      qr|$want$|i);
     like($fast_abs_path, qr|$want$|i);
-    like(Cwd::_perl_abs_path("linktest"), qr|$want$|i) if $EXTRA_ABSPATH_TESTS;
+    like(Cwd::_perl_abs_path($file), qr|$want$|i) if $EXTRA_ABSPATH_TESTS;
 
     rmtree($test_dirs[0], 0, 0);
-    1 while unlink "linktest";
+    1 while unlink $file;
 }
 
 if ($ENV{PERL_CORE}) {