summaryrefslogtreecommitdiff
path: root/t/win32
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-10-15 15:11:13 +1100
committerTony Cook <tony@develop-help.com>2020-12-01 15:29:33 +1100
commit2bfb75d20f6d643150258ffdbe1647239cb5f69a (patch)
tree008a37a226991c9fb026bf83d710ac7a53014656 /t/win32
parent203831af1a745c76df85e12f4a1cf47e5bddf3ff (diff)
downloadperl-2bfb75d20f6d643150258ffdbe1647239cb5f69a.tar.gz
lstat(), readlink() and unlink() treat directory junctions as symlinks
Diffstat (limited to 't/win32')
-rw-r--r--t/win32/stat.t4
-rw-r--r--t/win32/symlink.t7
2 files changed, 6 insertions, 5 deletions
diff --git a/t/win32/stat.t b/t/win32/stat.t
index 6046994f61..09f52ad957 100644
--- a/t/win32/stat.t
+++ b/t/win32/stat.t
@@ -112,10 +112,10 @@ if (system("mklink /d $tmpfile1 win32") == 0) {
rmdir( $tmpfile1 );
}
-# check a junction doesn't look like a symlink
+# check a junction looks like a symlink
if (system("mklink /j $tmpfile1 win32") == 0) {
- ok(!-l $tmpfile1, "lstat doesn't see a symlink on the directory junction");
+ ok(-l $tmpfile1, "lstat sees a symlink on the directory junction");
rmdir( $tmpfile1 );
}
diff --git a/t/win32/symlink.t b/t/win32/symlink.t
index 9716f3789c..e9088cd517 100644
--- a/t/win32/symlink.t
+++ b/t/win32/symlink.t
@@ -59,9 +59,10 @@ ok(mkdir($tmpfile1), "make a directory");
# this may only work in an admin shell
# MKLINK [[/D] | [/H] | [/J]] Link Target
if (system("mklink /j $tmpfile2 $tmpfile1") == 0) {
- ok(!-l $tmpfile2, "junction doesn't look like a symlink");
- ok(!unlink($tmpfile2), "no unlink magic for junctions");
- rmdir($tmpfile2);
+ ok(-l $tmpfile2, "junction does look like a symlink");
+ like(readlink($tmpfile2), qr/\Q$tmpfile1\E$/,
+ "readlink() works on a junction");
+ ok(unlink($tmpfile2), "unlink magic for junctions");
}
rmdir($tmpfile1);