[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 288e00d: Port time-stamp-test-time-zone to macOS
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 288e00d: Port time-stamp-test-time-zone to macOS |
Date: |
Thu, 10 Oct 2019 03:16:26 -0400 (EDT) |
branch: master
commit 288e00d69ac8d9907e8d6b8cccff2b3c914b2464
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
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".
---
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 ace5e58..37822f6 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."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 288e00d: Port time-stamp-test-time-zone to macOS,
Paul Eggert <=