aboutsummaryrefslogtreecommitdiff
path: root/tests/mventry/testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-03-07 14:07:28 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-03-09 14:18:20 +0300
commitdcccba655fe848564e961b3f285ce3a82d3ac73a (patch)
tree598ced3b406d80c23798672930e1a17cfe112b75 /tests/mventry/testscript
parent63b2988e4f2630cc688ff43b7e5f0d4f977896cd (diff)
Add more support for symlinks on Windows
See mksymlink() for details of the symlinks support on Windows.
Diffstat (limited to 'tests/mventry/testscript')
-rw-r--r--tests/mventry/testscript51
1 files changed, 46 insertions, 5 deletions
diff --git a/tests/mventry/testscript b/tests/mventry/testscript
index ecd617a..c6cbf45 100644
--- a/tests/mventry/testscript
+++ b/tests/mventry/testscript
@@ -92,8 +92,8 @@
:
: If we are not cross-testing let's test renaming symlynks from and over. On
: Windows that involves mklink command usability test. If we fail to create a
-: trial link (say because we are running non-administrative console), then the
-: test group will be silently skipped.
+: trial link (say because we are not in the Developer Mode and are running
+: non-elevated console), then the test group will be silently skipped.
:
if ($test.target == $build.host)
{
@@ -104,8 +104,12 @@ if ($test.target == $build.host)
if cmd /C 'mklink b a' >- 2>- &?b && cat b >'yes'
lns = cmd /C 'mklink b a' >-
end
+
+ jnc = cmd /C 'mklink /J b a' >-
end
+ : symlink
+ :
if! $empty($lns)
{
: file
@@ -126,11 +130,11 @@ if ($test.target == $build.host)
: to
:
- : Make sure that if destination is a symlink it is get overwritten and it's
- : target stays intact.
+ : Make sure that if destination is a symlink it is get overwritten and
+ : it's target stays intact.
:
echo 'foo' >=a;
- $lns;
+ $lns &b;
echo 'bar' >=c &!c;
$* c b;
cat a >'foo';
@@ -182,6 +186,43 @@ if ($test.target == $build.host)
$* b c 2>- == 1
}
}
+
+ : junction
+ :
+ if! $empty($jnc)
+ {
+ : from
+ :
+ : Make sure that if source is a junction it refers the same target after
+ : rename.
+ :
+ mkdir -p a;
+ $jnc &!b;
+ $* b c &c;
+ touch a/b;
+ test -f c/b;
+ test -d b == 1
+
+ : to
+ :
+ : Make sure that if destination is a junction it is get overwritten and
+ : it's target stays intact.
+ :
+ mkdir -p a;
+ $jnc;
+ echo 'foo' >=c &!c;
+ $* c b &b;
+ cat b >'foo';
+ test -d a;
+ test -f c == 1
+
+ : over-existing-dir
+ :
+ mkdir a;
+ $jnc &b;
+ mkdir c;
+ $* b c 2>- == 1
+ }
}
: different-fs