org-test: Fix wrong-numbre-of-arguments error on master+native-comp

* testing/org-test.el (org-test-at-time): Use correct number of
arguments in 'decode-time cl-letf binding. `decode-time' accepts up to
3 arguments on master.

The wrong-numbre-of-arguments error is raised on Emacs master
configured with native-comp support when running make test on Org mode
master.  Native-comp modifies function calls with optional arguments
in the way that omitted arguments are still provided as `nil'.  For
example, `decode-time' called as (decode-time time) in lisp source may
be compiled into (decode-time time nil nil) call by native-compiler.
If redefined `decode-time' does not accept 3 arguments, it result in
error.

See Emacs bug#48133.
This commit is contained in:
Ihor Radchenko 2021-05-02 16:29:02 +08:00 committed by Bastien
parent 5584ffc6c4
commit 0e7153e63d
1 changed files with 2 additions and 2 deletions

View File

@ -457,8 +457,8 @@ TIME can be a non-nil Lisp time value, or a string specifying a date and time."
(apply ,(symbol-function 'current-time-zone)
(or time ,at) args)))
((symbol-function 'decode-time)
(lambda (&optional time) (funcall ,(symbol-function 'decode-time)
(or time ,at))))
(lambda (&optional time zone form) (funcall ,(symbol-function 'decode-time)
(or time ,at) zone form)))
((symbol-function 'encode-time)
(lambda (time &rest args)
(apply ,(symbol-function 'encode-time) (or time ,at) args)))