emacs-diffs
[Top][All Lists]
Advanced

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

master 2d278a0f2e9: Use numeric time zone suffix in ERT explainer.


From: Philipp Stephani
Subject: master 2d278a0f2e9: Use numeric time zone suffix in ERT explainer.
Date: Tue, 25 Mar 2025 22:33:45 -0400 (EDT)

branch: master
commit 2d278a0f2e945eef30752550f900c1c88367fb6b
Author: Philipp Stephani <p.stephani2@gmail.com>
Commit: Philipp Stephani <p.stephani2@gmail.com>

    Use numeric time zone suffix in ERT explainer.
    
    This is more robust since the time zone name is system-dependent.
    
    * lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): Use numeric time
    zone suffix.
    
    * test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p):
    Adapt test.
---
 lisp/emacs-lisp/ert.el            | 4 ++--
 test/lisp/emacs-lisp/ert-tests.el | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index ef00dc73f91..b021c4d704c 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -676,8 +676,8 @@ A and B are the time values to compare."
            (side-effect-free t))
   (unless (time-equal-p a b)
     `(different-time-values
-      ,(format-time-string "%F %T.%N %Z" a t)
-      ,(format-time-string "%F %T.%N %Z" b t)
+      ,(format-time-string "%F %T.%N%z" a t)
+      ,(format-time-string "%F %T.%N%z" b t)
       difference
       ,(format-time-string "%s.%N" (time-subtract a b) t))))
 (function-put #'time-equal-p 'ert-explainer #'ert--explain-time-equal-p)
diff --git a/test/lisp/emacs-lisp/ert-tests.el 
b/test/lisp/emacs-lisp/ert-tests.el
index 7a08cb47d82..0ce531386c8 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -796,8 +796,8 @@ This macro is used to test if macroexpansion in `should' 
works."
   (should-not (ert--explain-time-equal-p 123 '(0 123 0 0)))
   (should (equal (ert--explain-time-equal-p 123 '(0 120 0 0))
                  '(different-time-values
-                   "1970-01-01 00:02:03.000000000 UTC"
-                   "1970-01-01 00:02:00.000000000 UTC"
+                   "1970-01-01 00:02:03.000000000+0000"
+                   "1970-01-01 00:02:00.000000000+0000"
                    difference "3.000000000"))))
 
 (ert-deftest ert-test-stats-set-test-and-result ()



reply via email to

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