emacs-31 0b30e299f51: Fix test breakage in files-tests

Juri Linkov <[email protected]> Tue, 7 Jul 2026 11:39:57 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit 0b30e299f512e02134082777e5161e2e189c769b
Author: Juri Linkov <[email protected]>
Commit: Juri Linkov <[email protected]>

    Fix test breakage in files-tests
    
    * test/lisp/files-tests.el (files-tests--with-buffer-offer-save):
    Redefine 'read-key-sequence-vector' instead of 'read-key'
    after recent changes in 'map-y-or-n-p' (bug#81168).
---
 test/lisp/files-tests.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 5001f9aaf96..d7ae7e3ea5f 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -2155,10 +2155,10 @@ CALLERS-DIR specifies the value to let-bind
             (setq nb-saved-buffers 0)
             (with-current-buffer (car buffers)
               (cl-letf
-                  (((symbol-function 'read-key)
+                  (((symbol-function 'read-key-sequence-vector)
                     ;; Increase counter and answer 'n' when prompted
                     ;; to save a buffer.
-                    (lambda (&rest _) (incf nb-saved-buffers) ?n))
+                    (lambda (&rest _) (incf nb-saved-buffers) [?n]))
                    ;; Do not kill Emacs.
                    ((symbol-function 'kill-emacs) #'ignore)
                    (save-some-buffers-default-predicate callers-dir))