comparison tests/automated/keymap-tests.el @ 5821:e34c3557e14e

Avoid commands defined in packages in some tests. Packages may not be available at make check time.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sun, 19 Oct 2014 17:54:46 +0900
parents cf0201de66df
children 21b5725c6a45
comparison
equal deleted inserted replaced
5819:ba0ff364bd94 5821:e34c3557e14e
29 (set-keymap-parent map parent-map) 29 (set-keymap-parent map parent-map)
30 (loop for (keys def) on '((shift tab) help-prev-symbol tab 30 (loop for (keys def) on '((shift tab) help-prev-symbol tab
31 help-next-symbol c customize-variable V 31 help-next-symbol c customize-variable V
32 find-variable-at-point q 32 find-variable-at-point q
33 help-mode-quit f find-function-at-point d 33 help-mode-quit f find-function-at-point d
34 describe-function-at-point D
34 describe-function-at-point v 35 describe-function-at-point v
35 describe-variable-at-point i Info-elisp-ref F 36 describe-variable-at-point i Info-elisp-ref F
36 find-function-at-point Q help-mode-bury button2 37 find-function-at-point Q help-mode-bury button2
37 help-mouse-find-source-or-track p 38 help-mouse-find-source-or-track p
38 help-prev-section n help-next-section return 39 help-prev-section n help-next-section return
61 register-to-point e view-scroll-lines-up \4 62 register-to-point e view-scroll-lines-up \4
62 digit-argument r recenter space scroll-up / 63 digit-argument r recenter space scroll-up /
63 view-search-forward N view-buffer m 64 view-search-forward N view-buffer m
64 point-to-register h view-mode-describe \7 65 point-to-register h view-mode-describe \7
65 digit-argument 66 digit-argument
66 find-function-at-point view-mode-describe) 67 describe-function-at-point view-mode-describe)
67 by #'cddr 68 by #'cddr
68 do (define-key parent-map (vector keys) def)) 69 do (define-key parent-map (vector keys) def))
69 (Assert (eq (key-binding [F]) 'find-function-at-point) 70 (Assert (eq (key-binding [F]) 'find-function-at-point)
70 "checking normal key lookup works, F") 71 "checking normal key lookup works, F")
71 (Assert (eq (key-binding [c]) 'customize-variable) 72 (Assert (eq (key-binding [c]) 'customize-variable)
72 "checking normal key lookup works, c") 73 "checking normal key lookup works, c")
73 (Assert (eq (key-binding [\2]) 'digit-argument) 74 (Assert (eq (key-binding [\2]) 'digit-argument)
74 "checking normal key parent lookup works, \\2") 75 "checking normal key parent lookup works, \\2")
75 (Assert (eq (key-binding [|]) 'shell-command-on-region) 76 (Assert (eq (key-binding [|]) 'shell-command-on-region)
76 "checking normal key parent lookup works, |") 77 "checking normal key parent lookup works, |")
77 (define-key map [remap find-function-at-point] #'find-file) 78 (define-key map [remap describe-function-at-point] #'find-file)
78 (Assert (eq (key-binding [F]) 'find-file) 79 (Assert (eq (key-binding [D]) 'find-file)
79 "checking remapped key lookup works, F") 80 "checking remapped key lookup works, d")
80 (Assert (eq (key-binding [f]) 'find-file) 81 (Assert (eq (key-binding [d]) 'find-file)
81 "checking remapped key lookup works, f") 82 "checking remapped key lookup works, f")
82 (Assert (eq (key-binding [\2]) 'digit-argument) 83 (Assert (eq (key-binding [\2]) 'digit-argument)
83 "checking normal key parent lookup works, \\2") 84 "checking normal key parent lookup works, \\2")
84 (Assert (eq (key-binding [|]) 'shell-command-on-region) 85 (Assert (eq (key-binding [|]) 'shell-command-on-region)
85 "checking normal key parent lookup works, |") 86 "checking normal key parent lookup works, |")
86 (Assert (eq (key-binding [find-function-at-point]) 'view-mode-describe) 87 (Assert (eq (key-binding [describe-function-at-point]) 'view-mode-describe)
87 "checking remapped function doesn't affect key name mapping") 88 "checking remapped function doesn't affect key name mapping")
88 (define-key parent-map [remap help-next-symbol] #'find-file) 89 (define-key parent-map [remap help-next-symbol] #'find-file)
89 (Assert (eq (key-binding [tab]) 'find-file) 90 (Assert (eq (key-binding [tab]) 'find-file)
90 "checking remapping in parent extends to child") 91 "checking remapping in parent extends to child")
91 (Assert (equal (commands-remapped-to 'find-file) 92 (Assert (equal (commands-remapped-to 'find-file)
92 '(help-next-symbol find-function-at-point)) 93 '(help-next-symbol describe-function-at-point))
93 "checking #'commands-remapped-to is sane") 94 "checking #'commands-remapped-to is sane")
94 (Check-Error wrong-type-argument (commands-remapped-to pi)) 95 (Check-Error wrong-type-argument (commands-remapped-to pi))
95 (Check-Error wrong-type-argument (commands-remapped-to 'find-file pi)) 96 (Check-Error wrong-type-argument (commands-remapped-to 'find-file pi))
96 (Check-Error wrong-type-argument (commands-remapped-to 'find-file nil pi)) 97 (Check-Error wrong-type-argument (commands-remapped-to 'find-file nil pi))
97 (Assert (eq (command-remapping 'find-function-at-point) 'find-file) 98 (Assert (eq (command-remapping 'describe-function-at-point) 'find-file)
98 "checking #'command-remapping is sane") 99 "checking #'command-remapping is sane")
99 (Check-Error wrong-type-argument (command-remapping pi)) 100 (Check-Error wrong-type-argument (command-remapping pi))
100 (Check-Error wrong-type-argument (command-remapping 'find-function-at-point 101 (Check-Error wrong-type-argument (command-remapping 'describe-function-at-point
101 pi)) 102 pi))
102 (Check-Error wrong-type-argument (command-remapping 'find-function-at-point 103 (Check-Error wrong-type-argument (command-remapping 'describe-function-at-point
103 nil pi))) 104 nil pi)))
104 105