emacs-diffs
[Top][All Lists]
Advanced

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

master 16ee227c18: icalendar-tests no longer assumes TZ = wall


From: Paul Eggert
Subject: master 16ee227c18: icalendar-tests no longer assumes TZ = wall
Date: Thu, 16 Jun 2022 00:06:16 -0400 (EDT)

branch: master
commit 16ee227c18db0d70d9a3e97230119464924797cc
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    icalendar-tests no longer assumes TZ = wall
    
    Do not assume that the TZ environment variable is either unset or
    agrees with /etc/localtime.  I ran into this test bug while
    running ‘TZ=America/Chicago make check’ on a platform where
    /etc/localtime was America/Los_Angeles.
    * test/lisp/calendar/icalendar-tests.el:
    (icalendar-tests--decode-isodatetime): Don’t use
    set-time-zone-rule, whose doc string says “Instead of calling this
    function, you typically want something else” for a reason.
    Instead, pass the zone arg to icalendar-test--format.
---
 test/lisp/calendar/icalendar-tests.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/test/lisp/calendar/icalendar-tests.el 
b/test/lisp/calendar/icalendar-tests.el
index c918b0f63f..ac7a84aa57 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -1639,19 +1639,17 @@ SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd 
oo Nnnnnnnn 30
                  "2004-09-17T03:09:10+0000"))
   (let ((orig (icalendar-test--format "20040917T050910")))
     (unwind-protect
-        (progn
-          (set-time-zone-rule "UTC-02:00")
-          (should (equal (icalendar-test--format "20040917T050910")
+       (let ((zone "XXX-02"))
+         (should (equal (icalendar-test--format "20040917T050910" nil zone)
                          "2004-09-17T03:09:10+0000"))
-          (should (equal (icalendar-test--format "20040917T0509")
+         (should (equal (icalendar-test--format "20040917T0509" nil zone)
                          "2004-09-17T03:09:00+0000"))
-          (should (equal (icalendar-test--format "20040917")
+         (should (equal (icalendar-test--format "20040917" nil zone)
                          "2004-09-16T22:00:00+0000"))
-          (should (equal (icalendar-test--format "20040917T050910" 1)
+         (should (equal (icalendar-test--format "20040917T050910" 1 zone)
                          "2004-09-18T03:09:10+0000"))
-          (should (equal (icalendar-test--format "20040917T050910" 30)
+         (should (equal (icalendar-test--format "20040917T050910" 30 zone)
                          "2004-10-17T03:09:10+0000")))
-      (set-time-zone-rule 'wall) ;; (set-time-zone-rule nil) is broken
       (should (equal orig (icalendar-test--format "20040917T050910")))))
   (should (equal (icalendar-test--format "20040917T050910Z")
                  "2004-09-17T05:09:10+0000"))



reply via email to

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