1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Fix 'whence -a' regression test (re: 99065353)

The regression test failed on systems where 'chmod' exists at more
than one location, e.g. Slackware where it's at both /bin/chmod and
/usr/bin/chmod.

src/cmd/ksh93/tests/builtins.sh: 'whence -a'/tracked aliases test:
- In the expected value, use modified 'whence -a -p chmod' output
  to get all of the paths to chmod.
- On failure, report both expected and actual values.
This commit is contained in:
Martijn Dekker 2020-06-30 01:43:25 +02:00
parent 1b5bc1802a
commit fa51a5ce3b

View file

@ -713,9 +713,10 @@ run_whence()
} }
actual="$(run_whence)" actual="$(run_whence)"
expected="chmod is a shell builtin expected="chmod is a shell builtin
chmod is $(whence -p chmod) $(whence -a -p chmod | sed 's/^/chmod is /')
chmod is a tracked alias for $(whence -p chmod)" chmod is a tracked alias for $(whence -p chmod)"
[[ $actual == $expected ]] || err_exit '`whence -a` does not work correctly with tracked aliases' [[ $actual == $expected ]] || err_exit "'whence -a' does not work correctly with tracked aliases" \
"(expected $(printf %q "$expected"), got $(printf %q "$actual"))"
# ====== # ======
# 'cd ../.foo' should not exclude the '.' in '.foo' # 'cd ../.foo' should not exclude the '.' in '.foo'