From fa51a5ce3b16a2d5a50d6d3ec392bd765884e2e2 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 30 Jun 2020 01:43:25 +0200 Subject: [PATCH] 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. --- src/cmd/ksh93/tests/builtins.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmd/ksh93/tests/builtins.sh b/src/cmd/ksh93/tests/builtins.sh index ab2fb699e..43b23fb82 100755 --- a/src/cmd/ksh93/tests/builtins.sh +++ b/src/cmd/ksh93/tests/builtins.sh @@ -713,9 +713,10 @@ run_whence() } actual="$(run_whence)" 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)" -[[ $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'