[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot d5167ea 29/62: Minor fixes to test infrastructure
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot d5167ea 29/62: Minor fixes to test infrastructure |
Date: |
Sat, 29 Sep 2018 17:13:32 -0400 (EDT) |
branch: externals/eglot
commit d5167eac527c75880d99024b4dafbf45319c0679
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Minor fixes to test infrastructure
* eglot-tests.el (eglot--with-timeout): Eval timeout.
(eglot--wait-for): Pass a list to eglot--with-timeout.
(eglot--tests-connect): Take optional timeout arg.
(formatting): Fix indentation and whitespace.vc ne
* Makefile (eglot-check): Load eglot directly to prevent loading
outdated version from ELPA/MELPA.
---
Makefile | 1 +
eglot-tests.el | 50 +++++++++++++++++++++++++-------------------------
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index 89cd593..a9d63e9 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ compile: $(ELCFILES)
eglot-check: compile
$(EMACS) -Q --batch $(LOAD_PATH) \
$(JSONRPC) \
+ -l eglot \
-l eglot-tests \
--eval '(ert-run-tests-batch-and-exit (quote $(SELECTOR)))'
diff --git a/eglot-tests.el b/eglot-tests.el
index 6940fcd..510573b 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -85,7 +85,7 @@
(cl-defmacro eglot--with-timeout (timeout &body body)
(declare (indent 1) (debug t))
- `(eglot--call-with-timeout ',timeout (lambda () ,@body)))
+ `(eglot--call-with-timeout ,timeout (lambda () ,@body)))
(defun eglot--call-with-timeout (timeout fn)
(let* ((tag (gensym "eglot-test-timeout"))
@@ -163,8 +163,8 @@
"Spin until FN match in EVENTS-SYM, flush events after it.
Pass TIMEOUT to `eglot--with-timeout'."
(declare (indent 2) (debug (sexp sexp sexp &rest form)))
- `(eglot--with-timeout (,timeout ,(or message
- (format "waiting for:\n%s"
(pp-to-string body))))
+ `(eglot--with-timeout '(,timeout ,(or message
+ (format "waiting for:\n%s"
(pp-to-string body))))
(let ((event
(cl-loop thereis (cl-loop for json in ,events-sym
for method = (plist-get json :method)
@@ -196,8 +196,8 @@ Pass TIMEOUT to `eglot--with-timeout'."
(define-derived-mode rust-mode prog-mode "Rust"))
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
-(defun eglot--tests-connect ()
- (eglot--with-timeout 2
+(defun eglot--tests-connect (&optional timeout)
+ (eglot--with-timeout (or timeout 2)
(apply #'eglot--connect (eglot--guess-contact))))
(ert-deftest auto-detect-running-server ()
@@ -381,26 +381,26 @@ Pass TIMEOUT to `eglot--with-timeout'."
(or (executable-find "yapf")
(executable-find "autopep8"))))
(eglot--with-dirs-and-files
- '(("project" . (("something.py" . "def a():pass\ndef b():pass"))))
- (with-current-buffer
- (eglot--find-file-noselect "project/something.py")
- (should (eglot--tests-connect))
- (search-forward "b():pa")
- (eglot-format (point-at-bol) (point-at-eol))
- (should (looking-at "ss"))
- (should
- (or
- ;; yapf
- (string= (buffer-string) "def a():pass\n\n\ndef b():\n pass\n")
- ;; autopep8
- (string= (buffer-string) "def a():pass\n\n\ndef b(): pass\n")))
- (eglot-format-buffer)
- (should
- (or
- ;; yapf
- (string= (buffer-string) "def a():\n pass\n\n\ndef b():\n pass\n")
- ;; autopep8
- (string= (buffer-string) "def a(): pass\n\n\ndef b(): pass\n"))))))
+ '(("project" . (("something.py" . "def a():pass\ndef b():pass"))))
+ (with-current-buffer
+ (eglot--find-file-noselect "project/something.py")
+ (should (eglot--tests-connect))
+ (search-forward "b():pa")
+ (eglot-format (point-at-bol) (point-at-eol))
+ (should (looking-at "ss"))
+ (should
+ (or
+ ;; yapf
+ (string= (buffer-string) "def a():pass\n\n\ndef b():\n pass\n")
+ ;; autopep8
+ (string= (buffer-string) "def a():pass\n\n\ndef b(): pass\n")))
+ (eglot-format-buffer)
+ (should
+ (or
+ ;; yapf
+ (string= (buffer-string) "def a():\n pass\n\n\ndef b():\n
pass\n")
+ ;; autopep8
+ (string= (buffer-string) "def a(): pass\n\n\ndef b(): pass\n"))))))
(ert-deftest javascript-basic ()
"Test basic autocompletion in a python LSP"
- [elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order, (continued)
- [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
- [elpa] externals/eglot bd6304d 57/62: Fix serious breakage introduced by #93, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 8e1a91b 31/62: Add a generic eglot-execute-command API, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot d5167ea 29/62: Minor fixes to test infrastructure,
Stefan Monnier <=
- [elpa] externals/eglot b0b16e2 37/62: Allow tests to be run with custom jsonrpc.el, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 8e0cf60 45/62: Fix textDocument/hover responses where MarkedString is a plist (#72), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 40f151b 51/62: Close #80: Consider :triggerCharacters in company completion, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e5b89af 53/62: Close #82: Correctly delete text before expanding snippet completions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f9beb19 55/62: When exiting emacs, don't ask the user to confirm killing processes (#83), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot badcaec 56/62: Don't warn on implementation-specific notifications (#93), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 042a236 49/62: * README.md (Obligatory animated gif section): Add snippet gif., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot b061873 61/62: Autoload eglot-ensure (#120), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f3f8531 58/62: Close #94: Prefer ccls over cquery for C/C++, Stefan Monnier, 2018/09/29