aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/keymap-tests.el
diff options
context:
space:
mode:
authorStefan Monnier2024-01-12 18:05:14 -0500
committerStefan Monnier2024-01-20 15:03:05 -0500
commiteb779ae64677e643d2d78cfc2b016088e8d7ff98 (patch)
tree1f42790f8434a4b77c2c1e8c10b3f9e549728af7 /test/src/keymap-tests.el
parenta764b503e126a60ff4ea1266da924de7b020637e (diff)
downloademacs-eb779ae64677e643d2d78cfc2b016088e8d7ff98.tar.gz
emacs-eb779ae64677e643d2d78cfc2b016088e8d7ff98.zip
* lisp/keymap.el (define-keymap): Demote "duplicate def" to a warning
* test/src/keymap-tests.el (keymap-test-duplicate-definitions): Adjust accordingly.
Diffstat (limited to 'test/src/keymap-tests.el')
-rw-r--r--test/src/keymap-tests.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index bc9977f31bf..04b897045db 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -23,6 +23,7 @@
23;;; Code: 23;;; Code:
24 24
25(require 'ert) 25(require 'ert)
26(require 'cl-lib)
26 27
27(defun keymap-tests--make-keymap-test (fun) 28(defun keymap-tests--make-keymap-test (fun)
28 (should (eq (car (funcall fun)) 'keymap)) 29 (should (eq (car (funcall fun)) 'keymap))
@@ -470,10 +471,18 @@ g .. h foo
470 ert-keymap-duplicate 471 ert-keymap-duplicate
471 "a" #'next-line 472 "a" #'next-line
472 "a" #'previous-line)) 473 "a" #'previous-line))
473 (should-error 474 (let ((msg ""))
474 (define-keymap 475 ;; FIXME: It would be nicer to use `current-message' rather than override
475 "a" #'next-line 476 ;; `message', but `current-message' returns always nil in batch mode :-(
476 "a" #'previous-line))) 477 (cl-letf (((symbol-function 'message)
478 (lambda (fmt &rest args) (setq msg (apply #'format fmt args)))))
479 (should
480 (string-match "duplicate"
481 (progn
482 (define-keymap
483 "a" #'next-line
484 "a" #'previous-line)
485 msg))))))
477 486
478(ert-deftest keymap-unset-test-remove-and-inheritance () 487(ert-deftest keymap-unset-test-remove-and-inheritance ()
479 "Check various behaviors of keymap-unset. (Bug#62207)" 488 "Check various behaviors of keymap-unset. (Bug#62207)"