]> code.delx.au - gnu-emacs/blob - test/automated/keymap-tests.el
524563fea50c2d9a7eb08e7d3504c64fa348a675
[gnu-emacs] / test / automated / keymap-tests.el
1 ;;; keymap-tests.el --- Test suite for src/keymap.c
2
3 ;; Copyright (C) 2015 Free Software Foundation, Inc.
4
5 ;; Author: Juanma Barranquero <lekktu@gmail.com>
6
7 ;; This file is part of GNU Emacs.
8
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.
13
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.
18
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/>.
21
22 ;;; Code:
23
24 (require 'ert)
25
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])))
30 (unwind-protect
31 (progn
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))))
40
41 (provide 'keymap-tests)
42
43 ;;; keymap-tests.el ends here