(ert-deftest help-tests-substitute-command-keys/keymaps ()
(with-substitute-command-keys-test
- (test "\\{minibuffer-local-must-match-map}"
+ (test-re "\\{minibuffer-local-must-match-map}"
"
Key Binding
-
+-+
C-g abort-minibuffers
TAB minibuffer-complete
C-j minibuffer-complete-and-exit
RET minibuffer-complete-and-exit
SPC minibuffer-complete-word
-? minibuffer-completion-help
+\\? minibuffer-completion-help
C-<tab> file-cache-minibuffer-complete
<XF86Back> previous-history-element
<XF86Forward> next-history-element
(with-substitute-command-keys-test
(with-temp-buffer
(help-tests-major-mode)
- (test "\\{help-tests-major-mode-map}"
+ (test-re "\\{help-tests-major-mode-map}"
"
Key Binding
-
+-+
( .. ) short-range
1 .. 4 foo-range
a .. c foo-other-range
(with-temp-buffer
(help-tests-major-mode)
(help-tests-minor-mode)
- (test "\\{help-tests-major-mode-map}"
+ (test-re "\\{help-tests-major-mode-map}"
"
Key Binding
-
+-+
( .. ) short-range
1 .. 4 foo-range
a .. c foo-other-range
(with-temp-buffer
(help-tests-major-mode)
(define-key help-tests-major-mode-map [remap foo] 'bar)
- (test "\\{help-tests-major-mode-map}"
+ (test-re "\\{help-tests-major-mode-map}"
"
Key Binding
-
+-+
<remap> <foo> bar
")))))
:enable mark-active
:help "Help text"))))))
(describe-map-tree map nil nil nil nil t nil nil nil)
- (should (equal (buffer-string) "
+ (should (string-match "
Key Binding
-
-C-a foo
-")))))
+-+
+C-a foo\n"
+ (buffer-string))))))
(ert-deftest help-tests-describe-map-tree/no-menu-nil ()
(with-temp-buffer
:enable mark-active
:help "Help text"))))))
(describe-map-tree map nil nil nil nil nil nil nil nil)
- (should (equal (buffer-string) "
+ (should (string-match "
Key Binding
-
+-+
C-a foo
-<menu-bar> <foo> foo
-")))))
+<menu-bar> <foo> foo\n"
+ (buffer-string))))))
(ert-deftest help-tests-describe-map-tree/mention-shadow-t ()
(with-temp-buffer
(2 . bar))))
(shadow-maps '((keymap . ((1 . baz))))))
(describe-map-tree map t shadow-maps nil nil t nil nil t)
- (should (equal (buffer-string) "
+ (should (string-match "
Key Binding
-
+-+
C-a foo
(this binding is currently shadowed)
-C-b bar
-")))))
+C-b bar\n"
+ (buffer-string))))))
(ert-deftest help-tests-describe-map-tree/mention-shadow-nil ()
(with-temp-buffer
(2 . bar))))
(shadow-maps '((keymap . ((1 . baz))))))
(describe-map-tree map t shadow-maps nil nil t nil nil nil)
- (should (equal (buffer-string) "
+ (should (string-match "
Key Binding
-
-C-b bar
-")))))
+-+
+C-b bar\n"
+ (buffer-string))))))
(ert-deftest help-tests-describe-map-tree/partial-t ()
(with-temp-buffer
(map '(keymap . ((1 . foo)
(2 . undefined)))))
(describe-map-tree map t nil nil nil nil nil nil nil)
- (should (equal (buffer-string) "
+ (should (string-match "
Key Binding
-
-C-a foo
-")))))
+-+
+C-a foo\n"
+ (buffer-string))))))
(ert-deftest help-tests-describe-map-tree/partial-nil ()
(with-temp-buffer
(map '(keymap . ((1 . foo)
(2 . undefined)))))
(describe-map-tree map nil nil nil nil nil nil nil nil)
- (should (equal (buffer-string) "
+ (should (string-match "
Key Binding
-
+-+
C-a foo
-C-b undefined
-")))))
+C-b undefined\n"
+ (buffer-string))))))
(defvar help-tests--was-in-buffer nil)