From: Paul Eggert Date: Thu, 10 Oct 2019 07:15:24 +0000 (-0700) Subject: Port time-stamp-test-time-zone to macOS X-Git-Tag: emacs-27.0.90~1169 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=288e00d69ac8d9907e8d6b8cccff2b3c914b2464;p=emacs.git Port time-stamp-test-time-zone to macOS Problem reported by Stefan Kangas in: https://lists.gnu.org/r/emacs-devel/2019-10/msg00360.html * test/lisp/time-stamp-tests.el (time-stamp-test-time-zone): Don’t assume (format-time-string "%Z" 0 t) returns "GMT". --- diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index ace5e58e367..37822f6e290 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el @@ -298,12 +298,14 @@ (ert-deftest time-stamp-test-time-zone () "Test time-stamp formats for time zone." (with-time-stamp-test-env - ;; implemented and documented since 1995 - (should (equal (time-stamp-string "%Z" ref-time) "GMT")) - ;; documented 1995-2019 - (should (equal (time-stamp-string "%z" ref-time) "gmt")) - ;; implemented since 1997, documented since 2019 - (should (equal (time-stamp-string "%#Z" ref-time) "gmt")))) + (let ((UTC-abbr (format-time-string "%Z" ref-time t)) + (utc-abbr (format-time-string "%#Z" ref-time t))) + ;; implemented and documented since 1995 + (should (equal (time-stamp-string "%Z" ref-time) UTC-abbr)) + ;; documented 1995-2019 + (should (equal (time-stamp-string "%z" ref-time) utc-abbr)) + ;; implemented since 1997, documented since 2019 + (should (equal (time-stamp-string "%#Z" ref-time) utc-abbr))))) (ert-deftest time-stamp-test-non-date-conversions () "Test time-stamp formats for non-date items."