[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot ae37c2a 35/62: Add a test for eglot-ensure. Make
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot ae37c2a 35/62: Add a test for eglot-ensure. Make |
Date: |
Sat, 29 Sep 2018 17:13:33 -0400 (EDT) |
branch: externals/eglot
commit ae37c2aa5eb6886cd522ec160c4c3cf210c2322b
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Add a test for eglot-ensure. Make
sure it runs last, since a bug in the python-flymake backend may
trigger a sentinel error that interferes with other tests.
* eglot-tests.el (zzz-eglot-ensure): New test.
(python, ert-x): Require it.
---
eglot-tests.el | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/eglot-tests.el b/eglot-tests.el
index 26ddf1f..33d96a5 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -26,7 +26,9 @@
(require 'eglot)
(require 'cl-lib)
(require 'ert)
+(require 'ert-x) ; ert-simulate-command
(require 'edebug)
+(require 'python) ; python-mode-hook
;; Helpers
@@ -431,6 +433,29 @@ Pass TIMEOUT to `eglot--with-timeout'."
(= severity 1))
diagnostics)))))))))
+(ert-deftest zzz-eglot-ensure ()
+ "Test basic `eglot-ensure' functionality"
+ (skip-unless (executable-find "pyls"))
+ (eglot--with-dirs-and-files
+ '(("project" . (("foo.py" . "import sys\nsys.exi")
+ ("bar.py" . "import sys\nsys.exi"))))
+ (let ((saved-python-mode-hook python-mode-hook)
+ server)
+ (unwind-protect
+ (progn
+ (add-hook 'python-mode-hook 'eglot-ensure)
+ ;; need `ert-simulate-command' because `eglot-ensure'
+ ;; relies on `post-command-hook'.
+ (with-current-buffer
+ (ert-simulate-command
+ '(find-file "project/foo.py"))
+ (should (setq server (eglot--current-server))))
+ (with-current-buffer
+ (ert-simulate-command
+ '(find-file "project/bar.py"))
+ (should (eq server (eglot--current-server)))))
+ (setq python-mode-hook saved-python-mode-hook)))))
+
(provide 'eglot-tests)
;;; eglot-tests.el ends here
- [elpa] externals/eglot 42fffa5 16/62: Close #54: Correctly make LSP positions in narrowed buffers, (continued)
- [elpa] externals/eglot 42fffa5 16/62: Close #54: Correctly make LSP positions in narrowed buffers, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e935718 20/62: Fix placement of diagnostics with same start and end positions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 88ebed6 17/62: Implement TextDocument/rangeFormatting, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 792dc6b 28/62: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 21886be 08/62: Close #44: Robustify in the face of manual mode changes, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6b14711 18/62: * eglot.el (eglot-client-capabilities): Fix a typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 4c019bd 24/62: * eglot.el (eglot-initialization-options): Fix spurious typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot a62c2da 25/62: Close #60: Notify server of recent changes before save notification, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8191b2 32/62: Improve eglot-execute-command API to ease overriding by servers, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 991d129 34/62: * README.md (Build Status): Show status for master, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot ae37c2a 35/62: Add a test for eglot-ensure. Make,
Stefan Monnier <=
- [elpa] externals/eglot cac728a 33/62: Kill server's output and events buffers from eglot-shutdown (#66), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 9ae03af 39/62: Close #41: Control the size of the events buffer, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6874895 42/62: Close #73: Prompt for server in interactive eglot-shutdown, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot dc26745 38/62: Update README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e05360a 50/62: Actually add snippet example gif referenced in README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8cccee 52/62: Ignore extra keys in textDocument/publishDiagnostics (#81), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6f1d64c 59/62: Close #100: Don't send other notifications before initialized, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f482c3e 60/62: Close #115: Don't block kill-buffer-hook if server somehow hangs, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 821b498 62/62: Correctly map DocumentSymbol's :kind to its name (#121), Stefan Monnier, 2018/09/29