1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

tests/builtins.sh: change GMT to UTC before testing (re: c9634e90)

Apparently some systems are still configured to use GMT instead of
UTC after all. This included our own GitHub CI runner config.
Oops. This made the previous commit fail to pass the CI test run.

We can't win this one, it's got to be either one or the other.
UTC is the international standard on which civil time is based.
GMT is often taken as synonymous for UTC, but in navigation,
it can differ from UTC by up to 0.9 seconds. Ref.:
https://en.wikipedia.org/w/index.php?title=Greenwich_Mean_Time&oldid=963422787
The more ambiguous term should not be the first preference.

src/cmd/ksh93/tests/builtins.sh:
- Before checking 'printf %T now' output against 'date' output,
  change any ' GMT ' in the latter to ' UTC '.

.github/workflows/ci.yml:
- Set time zone to UTC, not GMT.
This commit is contained in:
Martijn Dekker 2020-06-26 13:35:15 +02:00
parent c9634e908d
commit eaaa0de74d
2 changed files with 3 additions and 3 deletions

View file

@ -14,6 +14,6 @@ jobs:
run: bin/package make
- name: Regression tests
run: |
export TZ=GMT
export TZ=UTC
ulimit -n 1024
script -q -e -c "bin/shtests"

View file

@ -311,8 +311,8 @@ fi
[[ $(printf '%q\n') == '' ]] || err_exit 'printf "%q" with missing arguments'
# we won't get hit by the one second boundary twice, right?
expect= actual=
{ expect=$(LC_ALL=C date) && actual=$(LC_ALL=C printf '%T\n' now) && [[ $actual == "$expect" ]]; } ||
{ expect=$(LC_ALL=C date) && actual=$(LC_ALL=C printf '%T\n' now) && [[ $actual == "$expect" ]]; } ||
{ expect=$(LC_ALL=C date | sed 's/ GMT / UTC /') && actual=$(LC_ALL=C printf '%T\n' now) && [[ $actual == "$expect" ]]; } ||
{ expect=$(LC_ALL=C date | sed 's/ GMT / UTC /') && actual=$(LC_ALL=C printf '%T\n' now) && [[ $actual == "$expect" ]]; } ||
err_exit 'printf "%T" now' "(expected $(printf %q "$expect"), got $(printf %q "$actual"))"
behead()
{