emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master d36b0c2: Port format-time-string to MS-Windows bett


From: Paul Eggert
Subject: [Emacs-diffs] master d36b0c2: Port format-time-string to MS-Windows better
Date: Mon, 1 May 2017 19:03:12 -0400 (EDT)

branch: master
commit d36b0c2c80029880809e5a101eeb01da9fd9c219
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Port format-time-string to MS-Windows better
    
    * test/src/editfns-tests.el (format-time-string-with-zone):
    Port test cases to MS-Windows.
---
 test/src/editfns-tests.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index 7c555d9..8019eb0 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -148,25 +148,28 @@
   ;; second on 1972-06-30 23:59:60 UTC, so it should format to the
   ;; same string regardless of whether the underlying C library
   ;; ignores leap seconds, while avoiding circa-1970 glitches.
-  (let ((look '(1202 22527 999999 999999)))
+  ;;
+  ;; Similarly, stick to the limited set of time zones that are
+  ;; supported by both POSIX and MS-Windows: exactly 3 ASCII letters
+  ;; in the abbreviation, and no DST.
+  (let ((look '(1202 22527 999999 999999))
+        (format "%Y-%m-%d %H:%M:%S.%3N %z (%Z)"))
     ;; UTC.
     (should (string-equal
              (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z" look t)
              "1972-06-30 23:59:59.999 +0000"))
-    ;; Time zone without DST in 1972.
+    ;; "UTC0".
     (should (string-equal
-             (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z (%Z)" look 
"NZST-12")
-             "1972-07-01 11:59:59.999 +1200 (NZST)"))
-    ;; United States DST in 1972.
+             (format-time-string format look "UTC0")
+             "1972-06-30 23:59:59.999 +0000 (UTC)"))
+    ;; Negative UTC offset, as a Lisp list.
     (should (string-equal
-             (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z (%Z)" look
-                                 "PST8PDT,M4.5.0,M10.5.0")
-             "1972-06-30 16:59:59.999 -0700 (PDT)"))
-    ;; New South Wales DST in 1971-2.
+             (format-time-string format look '(-28800 "PST"))
+             "1972-06-30 15:59:59.999 -0800 (PST)"))
+    ;; Positive UTC offset that is not an hour multiple, as a string.
     (should (string-equal
-             (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z (%Z)" look
-                                 "AEST-10AEDT,M10.5.0,M2.5.0/3")
-             "1972-07-01 09:59:59.999 +1000 (AEST)"))))
+             (format-time-string format look "IST-5:30")
+             "1972-07-01 05:29:59.999 +0530 (IST)"))))
 
 ;;; This should not dump core.
 (ert-deftest format-time-string-with-outlandish-zone ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]