]> code.delx.au - gnu-emacs/blobdiff - test/automated/keymap-tests.el
Update copyright year to 2016
[gnu-emacs] / test / automated / keymap-tests.el
index 482ed27cd4fb3469c48bbd169b9b2a31cf726328..b835fc7530b1c2af286ee274cd0aae1ed26d1dbf 100644 (file)
@@ -1,6 +1,6 @@
 ;;; keymap-tests.el --- Test suite for src/keymap.c
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
 
 ;; Author: Juanma Barranquero <lekktu@gmail.com>
 
 
 (require 'ert)
 
-(ert-deftest keymap-store_in_keymap-FASTINT-on-nonchars ()
+(ert-deftest keymap-store_in_keymap-XFASTINT-on-non-characters ()
   "Check for bug fixed in \"Fix assertion violation in define-key\",
 commit 86c19714b097aa477d339ed99ffb5136c755a046."
-  (should-not (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined))
-  ;; This will cause an assertion violation if the bug is present.
-  ;; We could run an inferior Emacs process and check for the return
-  ;; status, but in some environments an assertion failure triggers
-  ;; an abort dialog that requires user intervention anyway.
-  (define-key Buffer-menu-mode-map [(32 . 126)] 'undefined)
-  (should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined)))
+  (let ((def (lookup-key Buffer-menu-mode-map [32])))
+    (unwind-protect
+        (progn
+          (should-not (eq def 'undefined))
+          ;; This will cause an assertion violation if the bug is present.
+          ;; We could run an inferior Emacs process and check for the return
+          ;; status, but in some environments an assertion failure triggers
+          ;; an abort dialog that requires user intervention anyway.
+          (define-key Buffer-menu-mode-map [(32 . 32)] 'undefined)
+          (should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined)))
+      (define-key Buffer-menu-mode-map [32] def))))
 
 (provide 'keymap-tests)