From 1afe9ecfd78d89cee991262f3335eca2ab0763ac Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 10 Sep 2024 04:34:53 +0300 Subject: [PATCH] eglot-test-rust-completion-exit-function: Fix failure in -Q session * 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index c0e30172482..eaef990d5ea 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -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 () -- 2.39.5