1 ;;; keymap-tests.el --- Test suite for src/keymap.c
3 ;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
5 ;; Author: Juanma Barranquero <lekktu@gmail.com>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26 (ert-deftest keymap-store_in_keymap-XFASTINT-on-non-characters
()
27 "Check for bug fixed in \"Fix assertion violation in define-key\",
28 commit 86c19714b097aa477d339ed99ffb5136c755a046."
29 (let ((def (lookup-key Buffer-menu-mode-map
[32])))
32 (should-not (eq def 'undefined))
33 ;; This will cause an assertion violation if the bug is present.
34 ;; We could run an inferior Emacs process and check for the return
35 ;; status, but in some environments an assertion failure triggers
36 ;; an abort dialog that requires user intervention anyway.
37 (define-key Buffer-menu-mode-map [(32 . 32)] 'undefined)
38 (should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined
)))
39 (define-key Buffer-menu-mode-map
[32] def))))
41 (provide 'keymap-tests)
43 ;;; keymap-tests.el ends here