diff options
author | Ulrich Müller <ulm@gentoo.org> | 2024-08-29 19:35:57 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2024-08-29 19:35:57 +0200 |
commit | b5c893ab2e06457a0d2343e1b41e814d83dbf6dd (patch) | |
tree | 8f9895cc6411bf7db2bf8b9786569cdc37280954 | |
parent | Version 1.74 released (diff) | |
download | ebuild-mode-b5c893ab2e06457a0d2343e1b41e814d83dbf6dd.tar.gz ebuild-mode-b5c893ab2e06457a0d2343e1b41e814d83dbf6dd.tar.bz2 ebuild-mode-b5c893ab2e06457a0d2343e1b41e814d83dbf6dd.zip |
Avoid date-to-time in tests
* test/ebuild-mode-tests.el (ebuild-mode-test-run-with-fixed-time):
* test/glep-mode-tests.el (glep-mode-test-run-with-fixed-time):
Use encode-time instead of date-to-time. Bug 938666.
Bug: https://bugs.gentoo.org/938666
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/ebuild-mode-tests.el | 7 | ||||
-rw-r--r-- | test/glep-mode-tests.el | 7 |
3 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2024-08-29 Ulrich Müller <ulm@gentoo.org> + + * test/ebuild-mode-tests.el (ebuild-mode-test-run-with-fixed-time): + * test/glep-mode-tests.el (glep-mode-test-run-with-fixed-time): + Use encode-time instead of date-to-time. Bug 938666. + 2024-08-28 Ulrich Müller <ulm@gentoo.org> * Version 1.74 released. diff --git a/test/ebuild-mode-tests.el b/test/ebuild-mode-tests.el index 5c9d944..7ff98d5 100644 --- a/test/ebuild-mode-tests.el +++ b/test/ebuild-mode-tests.el @@ -32,7 +32,12 @@ (let ((zone (if (or (not (featurep 'xemacs)) (function-allows-args #'format-time-string 3)) (list 'zone)))) - `(cl-letf* ((fixed-time (date-to-time "2024-08-10 00:00:00 +0000")) + `(cl-letf* ((calendrical '(0 0 0 10 8 2024 nil nil 0)) + (fixed-time (condition-case nil + ;; new calling convention since Emacs 27 + (encode-time calendrical) + (wrong-number-of-arguments + (apply #'encode-time calendrical)))) (orig-fun (symbol-function 'format-time-string)) ((symbol-function 'format-time-string) (lambda (fmt-string &optional time ,@zone) diff --git a/test/glep-mode-tests.el b/test/glep-mode-tests.el index 7318293..cc2e162 100644 --- a/test/glep-mode-tests.el +++ b/test/glep-mode-tests.el @@ -24,7 +24,12 @@ (require 'glep-mode) (defmacro glep-mode-test-run-with-fixed-time (&rest body) - `(cl-letf* ((fixed-time (date-to-time "2024-08-10 00:00:00 +0000")) + `(cl-letf* ((calendrical '(0 0 0 10 8 2024 nil nil 0)) + (fixed-time (condition-case nil + ;; new calling convention since Emacs 27 + (encode-time calendrical) + (wrong-number-of-arguments + (apply #'encode-time calendrical)))) (orig-fun (symbol-function 'format-time-string)) ((symbol-function 'format-time-string) (lambda (fmt-string &optional time zone) |