[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.2 38a27be 029/101: Add a test for eglot-ensure. Make
From: |
Christian Johansson |
Subject: |
[elpa] 1.2 38a27be 029/101: Add a test for eglot-ensure. Make |
Date: |
Thu, 29 Apr 2021 15:08:54 -0400 (EDT) |
tag: 1.2
commit 38a27becbb5099a9c9b7e7480d1876c30364cc9e
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
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] 1.2 updated (f291816 -> e70be91), Christian Johansson, 2021/04/29
- [elpa] 1.2 1015f83 004/101: Per #48: Fix messages of eglot-ensure, Christian Johansson, 2021/04/29
- [elpa] 1.2 4a7086e 016/101: Per #59: eglot-workspace-configuration's keys needn't be keywords, Christian Johansson, 2021/04/29
- [elpa] 1.2 310e527 006/101: * README.md (Installation and usage): Add haskell-ide-engine, Christian Johansson, 2021/04/29
- [elpa] 1.2 f2a6aa3 010/101: Close #54: Correctly make LSP positions in narrowed buffers, Christian Johansson, 2021/04/29
- [elpa] 1.2 d845453 019/101: Close #60: Notify server of recent changes before save notification, Christian Johansson, 2021/04/29
- [elpa] 1.2 d8c1f5d 026/101: Improve eglot-execute-command API to ease overriding by servers, Christian Johansson, 2021/04/29
- [elpa] 1.2 d48e737 017/101: Per #63: Accept functions as entries in eglot-server-programs, Christian Johansson, 2021/04/29
- [elpa] 1.2 b0c6e17 035/101: Add kotlin-language-server (#70), Christian Johansson, 2021/04/29
- [elpa] 1.2 38a27be 029/101: Add a test for eglot-ensure. Make,
Christian Johansson <=
- [elpa] 1.2 05e5a9f 063/101: Per #63: Allow function contacts to be interactive, Christian Johansson, 2021/04/29
- [elpa] 1.2 922f4e5 060/101: Merge pull request #104 from mkcms/fix-diagnostics-wrong-type-argument, Christian Johansson, 2021/04/29
- [elpa] 1.2 7b78b15 055/101: Autoload eglot-ensure (#120), Christian Johansson, 2021/04/29
- [elpa] 1.2 bfadd9a 053/101: Close #100: Don't send other notifications before initialized, Christian Johansson, 2021/04/29
- [elpa] 1.2 737f08d 056/101: Correctly map DocumentSymbol's :kind to its name (#121), Christian Johansson, 2021/04/29
- [elpa] 1.2 3c9e00e 068/101: * .travis.yml (install): Download eclipse.jdt.ls server., Christian Johansson, 2021/04/29
- [elpa] 1.2 be464f2 005/101: Add entry for haskell-ide-engine in eglot-server-programs (#49), Christian Johansson, 2021/04/29
- [elpa] 1.2 0694579 009/101: Fix typo in willSaveWaitUntil RPC request (#51), Christian Johansson, 2021/04/29
- [elpa] 1.2 f4f93d3 014/101: Fix placement of diagnostics with same start and end positions, Christian Johansson, 2021/04/29
- [elpa] 1.2 01ec85f 011/101: Implement TextDocument/rangeFormatting, Christian Johansson, 2021/04/29