emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot c3bae0a 44/69: New test for the eglot-autoshutdow


From: João Távora
Subject: [elpa] externals/eglot c3bae0a 44/69: New test for the eglot-autoshutdown defcustom
Date: Sun, 20 Oct 2019 08:21:50 -0400 (EDT)

branch: externals/eglot
commit c3bae0afc068ff9d3d238cb684206444c38f4dad
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    New test for the eglot-autoshutdown defcustom
    
    * eglot-tests.el (auto-shutdown): New test.
---
 eglot-tests.el | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/eglot-tests.el b/eglot-tests.el
index 82dfe6c..d61537d 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -292,6 +292,25 @@ Pass TIMEOUT to `eglot--with-timeout'."
           (eglot--find-file-noselect "anotherproject/cena.rs")
         (should-error (eglot--current-server-or-lose))))))
 
+(ert-deftest auto-shutdown ()
+  "Visit a file and M-x eglot, then kill buffer. "
+  (skip-unless (executable-find "pyls"))
+  (let (server
+        buffer)
+    (eglot--with-fixture
+        '(("project" . (("coiso.py" . "def coiso: pass"))))
+      (with-current-buffer
+          (setq buffer (eglot--find-file-noselect "project/coiso.py"))
+        (should (setq server (eglot--tests-connect)))
+        (should (eglot--current-server))
+        (let ((eglot-autoshutdown nil)) (kill-buffer buffer))
+        (should (jsonrpc-running-p server))
+        ;; re-find file...
+        (setq buffer (eglot--find-file-noselect (buffer-file-name buffer)))
+        ;; ;; but now kill it with `eglot-autoshutdown' set to t
+        (let ((eglot-autoshutdown t)) (kill-buffer buffer))
+        (should (not (jsonrpc-running-p server)))))))
+
 (ert-deftest auto-reconnect ()
   "Start a server. Kill it. Watch it reconnect."
   (skip-unless (executable-find "rls"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]