1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

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.
This commit is contained in:
Johnothan King 2020-06-22 15:55:51 -07:00 committed by GitHub
parent 85165ee5e1
commit e0b326ae15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()
{