]> git.eshelyaron.com Git - emacs.git/commitdiff
Update some tests
authorEshel Yaron <me@eshelyaron.com>
Mon, 1 Jul 2024 13:14:45 +0000 (15:14 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 1 Jul 2024 13:14:45 +0000 (15:14 +0200)
test/lisp/completion-preview-tests.el
test/lisp/progmodes/etags-tests.el
test/lisp/simple-tests.el

index b50d999e69a8384bc02207a0f81e79c07d1a2a97..85b81eed486338fa74e4d062886ba2d63c8f006a 100644 (file)
@@ -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)
index 45a12a7acc0ea61c9323cf6093c1916e4289b21f..dd2220d3aa2dc9b4ac81ff232b39bc027ea0a281 100644 (file)
@@ -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)
index d94fa4a583d71ac9eeb4942b1cc73e6d8c1cf28a..2a69beec0ed104ffdb764675134fafd8fc0b5fcd 100644 (file)
@@ -119,31 +119,14 @@ mark there."
 \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'