From df99b0f13c8abd0a4944e95fb04d927d9292fc2e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 1 Jul 2024 15:14:45 +0200 Subject: [PATCH] Update some tests --- test/lisp/completion-preview-tests.el | 3 ++- test/lisp/progmodes/etags-tests.el | 2 ++ test/lisp/simple-tests.el | 23 +++-------------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/test/lisp/completion-preview-tests.el b/test/lisp/completion-preview-tests.el index b50d999e69a..85b81eed486 100644 --- a/test/lisp/completion-preview-tests.el +++ b/test/lisp/completion-preview-tests.el @@ -279,7 +279,8 @@ instead." (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) diff --git a/test/lisp/progmodes/etags-tests.el b/test/lisp/progmodes/etags-tests.el index 45a12a7acc0..dd2220d3aa2 100644 --- a/test/lisp/progmodes/etags-tests.el +++ b/test/lisp/progmodes/etags-tests.el @@ -41,6 +41,7 @@ "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 ".")) @@ -91,6 +92,7 @@ "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) diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index d94fa4a583d..2a69beec0ed 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el @@ -119,31 +119,14 @@ mark there." ;;; `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")))) ;;; `transpose-sexps' -- 2.39.2