(setq exit-fn-called t
exit-fn-args args)))))
(completion-preview-tests--insert-and-preview "foo")
- (completion-preview-tests--check-preview "bar" 'completion-preview-common)
+ (completion-preview-tests--check-preview "bar-1 2"
+ 'completion-preview-common)
(completion-preview-insert)
(should (string= (buffer-string) "foobar-1 2"))
(should-not completion-preview--overlay)
"Test finding tags with local and global tags tables."
(let ((buf-with-global-tags (get-buffer-create "*buf-global*"))
(buf-with-local-tags (get-buffer-create "*buf-local*"))
+ (xref-backend-functions '(etags--xref-backend))
xref-buf)
(set-buffer buf-with-global-tags)
(setq default-directory (expand-file-name "."))
"Test that setting a local value of tags table doesn't signal errors."
(set-buffer (get-buffer-create "*foobar*"))
(fundamental-mode)
+ (setq-local xref-backend-functions '(etags--xref-backend))
(visit-tags-table
(expand-file-name "manual/etags/ETAGS.good_3" etags-tests--test-dir)
t)
\f
;;; `execute-extended-command'
-(ert-deftest simple-execute-extended-command--shorter ()
- ;; This test can be flaky with completion frameworks other than the
- ;; default, so just skip it in interactive sessions.
- (skip-unless noninteractive)
- (should (equal (execute-extended-command--shorter
- "display-line-numbers-mode"
- "display-line")
- ;; Depending on the tests performed and their order, we
- ;; could have loaded Dired, which defines commands
- ;; starting with "dir".
- (if (featurep 'dired)
- "dis-n"
- "di-n"))))
-
(ert-deftest simple-execute-extended-command--describe-binding-msg ()
(let ((text-quoting-style 'grave))
(should (equal (execute-extended-command--describe-binding-msg
- 'foo "m" nil)
+ 'foo "m")
"You can run the command `foo' with m"))
(should (equal (execute-extended-command--describe-binding-msg
- 'foo [14] nil)
- "You can run the command `foo' with C-n"))
- (should (equal (execute-extended-command--describe-binding-msg
- 'display-line-numbers-mode nil "di-n")
- "You can run the command `display-line-numbers-mode' with M-x di-n"))))
+ 'foo [14])
+ "You can run the command `foo' with C-n"))))
\f
;;; `transpose-sexps'