>From a05609991f68de5825b37a9ed6b1e5d2cccbd2ae Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 10 Oct 2019 00:15:24 -0700 Subject: [PATCH] Port time-stamp-test-time-zone to macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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". --- test/lisp/time-stamp-tests.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index ace5e58e36..37822f6e29 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el @@ -298,12 +298,14 @@ time-stamp-test-day-number-in-week (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." -- 2.17.1