From ef4fe4106c8a6efe2cf27b1a5448a642d77ba25b Mon Sep 17 00:00:00 2001 From: Johnothan King Date: Sun, 14 Mar 2021 14:32:04 -0700 Subject: [PATCH] Fix a few regression test failures (#222) src/cmd/ksh93/tests/_common: - Commit aed5c6d7 renamed the err_exit function, breaking a few tests in glob.sh that call the function directly instead of using the alias. Restore the function. src/cmd/ksh93/tests/builtins.sh: - The dtksh builtins don't have optget option parsing, so skip the unrecognized options test for those (this of course only has relevance when running dtksh against the regression tests). src/cmd/ksh93/tests/pty.sh: - If the vi editor couldn't be found on the $PATH, skip the regression test that involves it. --- src/cmd/ksh93/tests/_common | 7 ++++++- src/cmd/ksh93/tests/builtins.sh | 2 +- src/cmd/ksh93/tests/pty.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cmd/ksh93/tests/_common b/src/cmd/ksh93/tests/_common index a3dfbc72e..8c1cb7e3f 100644 --- a/src/cmd/ksh93/tests/_common +++ b/src/cmd/ksh93/tests/_common @@ -19,7 +19,12 @@ _message() { print -r $'\t'"${Command}[$1]: ${@:2}" >&2 } -alias err_exit='_message "$((Errors++,LINENO))"' # inaccurate err_exit name kept for historical integrity :) +function err_exit +{ + _message "$@" + let Errors+=1 +} +alias err_exit='err_exit $LINENO' # inaccurate err_exit name kept for historical integrity :) alias warning='_message "$LINENO" "warning:"' Command=${0##*/} diff --git a/src/cmd/ksh93/tests/builtins.sh b/src/cmd/ksh93/tests/builtins.sh index ab931664d..297be3928 100755 --- a/src/cmd/ksh93/tests/builtins.sh +++ b/src/cmd/ksh93/tests/builtins.sh @@ -963,7 +963,7 @@ EOF # Builtins should handle unrecognized options correctly while IFS= read -r bltin <&3 do case $bltin in - echo | test | true | false | \[ | : | getconf | */getconf | uname | */uname | login | newgrp) + echo | test | true | false | \[ | : | getconf | */getconf | uname | */uname | Dt* | X* | login | newgrp ) continue ;; /*/*) expect="Usage: ${bltin##*/} " actual=$({ PATH=${bltin%/*}; "${bltin##*/}" --this-option-does-not-exist; } 2>&1) ;; diff --git a/src/cmd/ksh93/tests/pty.sh b/src/cmd/ksh93/tests/pty.sh index 3877c865d..83b2bd0b0 100755 --- a/src/cmd/ksh93/tests/pty.sh +++ b/src/cmd/ksh93/tests/pty.sh @@ -391,7 +391,7 @@ r history fi # err_exit # -((SHOPT_VSH)) && tst $LINENO <<"!" +((SHOPT_VSH)) && whence -q vi && tst $LINENO <<"!" L POSIX sh 137(C) # If the User Portability Utilities Option is supported and shell