From e0b326ae15bf327b8a2969d3b6829e52b77c881e Mon Sep 17 00:00:00 2001 From: Johnothan King Date: Mon, 22 Jun 2020 15:55:51 -0700 Subject: [PATCH] Fix a test failure for `printf %T now` on Linux (#38) src/cmd/ksh93/tests/builtins.sh: - The output of 'printf %T now' and the external 'date' command aren't guaranteed to be the same unless $LC_ALL is set to 'C'. Set LC_ALL in these command substitutions to fix a spurious test failure on Linux. --- src/cmd/ksh93/tests/builtins.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/ksh93/tests/builtins.sh b/src/cmd/ksh93/tests/builtins.sh index 24c583452..1ab83167e 100755 --- a/src/cmd/ksh93/tests/builtins.sh +++ b/src/cmd/ksh93/tests/builtins.sh @@ -310,8 +310,8 @@ then err_exit "printf '%..*s' not working" fi [[ $(printf '%q\n') == '' ]] || err_exit 'printf "%q" with missing arguments' # we won't get hit by the one second boundary twice, right? -[[ $(printf '%T\n' now) == "$(date)" ]] || -[[ $(printf '%T\n' now) == "$(date)" ]] || +[[ $(LC_ALL=C printf '%T\n' now) == "$(LC_ALL=C date)" ]] || +[[ $(LC_ALL=C printf '%T\n' now) == "$(LC_ALL=C date)" ]] || err_exit 'printf "%T" now' behead() {