aboutsummaryrefslogtreecommitdiff
path: root/tests/builtin
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-09-29 19:10:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-09-30 09:05:25 +0300
commitf8ca402859c2f9c9547c0374ea9a53dd6c6abc3c (patch)
tree42116766a146cef4e089ad1a7accf24ce5678e80 /tests/builtin
parente0385d5e3fd8bdd160ff959c0950a8f351d39a7b (diff)
Fix find builtin to dereference symlink argument if terminated with directory separator (GH issue #434)
Diffstat (limited to 'tests/builtin')
-rw-r--r--tests/builtin/find.testscript24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/builtin/find.testscript b/tests/builtin/find.testscript
index b09822c..5971108 100644
--- a/tests/builtin/find.testscript
+++ b/tests/builtin/find.testscript
@@ -44,6 +44,30 @@ $* . -mindepth 12a 2>"find: invalid value '12a' for primary '-mindepth'" == 1
: path
:
{
+ : dir-symlink
+ :
+ {
+ mkdir -p a/c;
+ ln -s a c;
+
+ # If 'c' path is a symlink (may not be the case on Windows), then check
+ # that the find builtin only dereferences it if it is terminated with the
+ # directory separator.
+ #
+ $* c -type l | set p;
+
+ if ($p == 'c')
+ $* c >>EOO
+ c
+ EOO
+ end;
+
+ $* c/ -type d >>EOO
+ c/
+ c/c
+ EOO
+ }
+
: relative
:
{