]> git.eshelyaron.com Git - emacs.git/commitdiff
eglot-test-rust-completion-exit-function: Fix failure in -Q session
authorDmitry Gutov <dmitry@gutov.dev>
Tue, 10 Sep 2024 01:34:53 +0000 (04:34 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 14 Sep 2024 20:20:14 +0000 (22:20 +0200)
* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Check for buffer liveness (https://debbugs.gnu.org/72765#29).
(eglot-test-rust-completion-exit-function): Don't expect snippet
expansion to happen (no yasnippet in batch mode).

(cherry picked from commit 818c0cc9a51a1d678749404cdacdf640d6f32d6e)

test/lisp/progmodes/eglot-tests.el

index c0e30172482d73073ae9f3e596058c5bc38e472b..eaef990d5ea37cddac17627b43cb9d1e93059448 100644 (file)
@@ -136,9 +136,11 @@ directory hierarchy."
                                           (jsonrpc-events-buffer server)))))
                   (cond (noninteractive
                          (dolist (buffer buffers)
-                           (eglot--test-message "contents of `%s':" (buffer-name buffer))
-                           (princ (with-current-buffer buffer (buffer-string))
-                                  'external-debugging-output)))
+                           (eglot--test-message "contents of `%s' %S:" (buffer-name buffer) buffer)
+                           (if (buffer-live-p buffer)
+                               (princ (with-current-buffer buffer (buffer-string))
+                                      'external-debugging-output)
+                             (princ "Killed\n" #'external-debugging-output))))
                         (t
                          (eglot--test-message "Preserved for inspection: %s"
                                               (mapconcat #'buffer-name buffers ", "))))))))
@@ -724,7 +726,7 @@ directory hierarchy."
         (minibuffer-choose-completion t))
       (should
        (equal
-        "fn test() -> i32 { let v: usize = 1; v.count_ones().1234567890;"
+        "fn test() -> i32 { let v: usize = 1; v.count_ones.1234567890;"
         (buffer-string))))))
 
 (ert-deftest eglot-test-basic-xref ()