[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa a04b826 48/71: Update tests after update to newer
From: |
João Távora |
Subject: |
[elpa] externals/elpa a04b826 48/71: Update tests after update to newer Eldoc |
Date: |
Wed, 16 Dec 2020 11:42:24 -0500 (EST) |
branch: externals/elpa
commit a04b8266ec12a6f65db09884c02ea7a8d1b52f52
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Update tests after update to newer Eldoc
It's likely that these will fail until the very latest Emacs master is
available in travis.
* eglot-tests.el (eglot--eldoc-on-demand)
(eglot--tests-force-full-eldoc): New helpers.
(rls-hover-after-edit): Use new helpers.
(hover-multiline-doc-locus): Remove.
(hover-after-completions): Remove
(eglot-single-line-eldoc, eglot-multiline-eldoc)
(egnnlot-eldoc-after-completions): New tests.
---
eglot-tests.el | 86 ++++++++++++++++++++++++++++++++++++----------------------
1 file changed, 53 insertions(+), 33 deletions(-)
diff --git a/eglot-tests.el b/eglot-tests.el
index 2f8e25f..37f3c06 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -420,6 +420,27 @@ Pass TIMEOUT to `eglot--with-timeout'."
(flymake-goto-next-error 1 '() t)
(should (eq 'flymake-error (face-at-point)))))))
+(defun eglot--eldoc-on-demand ()
+ ;; Trick Eldoc 1.1.0 into accepting on-demand calls.
+ (let ((this-command nil) (last-command 'forward-char))
+ (should (eldoc-display-message-p))
+ (eldoc)))
+
+(defun eglot--tests-force-full-eldoc ()
+ (let ((origin (current-buffer)))
+ (with-current-buffer (eldoc-doc-buffer)
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (with-current-buffer origin
+ (eglot--eldoc-on-demand))
+ (cl-loop
+ repeat 10
+ while (zerop (length (buffer-string)))
+ do (sit-for 0.1))
+ (should (cl-plusp (length (buffer-string))))
+ (message "returning %s" (buffer-string))
+ (buffer-string)))))
+
(ert-deftest rls-hover-after-edit ()
"Hover and highlightChanges are tricky in RLS."
(skip-unless (executable-find "rls"))
@@ -444,7 +465,7 @@ Pass TIMEOUT to `eglot--with-timeout'."
;; simulate these two which don't happen when buffer isn't
;; visible in a window.
(eglot--signal-textDocument/didChange)
- (eglot-eldoc-function))
+ (eglot--eldoc-on-demand))
(let (pending-id)
(eglot--wait-for (c-reqs 2)
(&key id method &allow-other-keys)
@@ -542,49 +563,48 @@ def foobazquuz(d, e, f): pass
;; pyls will change the representation of this candidate
(should (member "foobazquuz(d, e, f)" company-candidates)))))
-(ert-deftest hover-after-completions ()
+(ert-deftest eglot-eldoc-after-completions ()
"Test documentation echo in a python LSP"
(skip-unless (executable-find "pyls"))
- ;; JT@19/06/21: We check with `eldoc-last-message' because it's
- ;; practical, which forces us to use
- ;; `eglot-put-doc-in-help-buffer' to nil.
- (let ((eglot-put-doc-in-help-buffer nil))
- (eglot--with-fixture
- `(("project" . (("something.py" . "import sys\nsys.exi"))))
- (with-current-buffer
- (eglot--find-file-noselect "project/something.py")
- (should (eglot--tests-connect))
- (goto-char (point-max))
- (setq eldoc-last-message nil)
- (completion-at-point)
- (should (looking-back "sys.exit"))
- (while (not eldoc-last-message) (accept-process-output nil 0.1))
- (should (string-match "^exit" eldoc-last-message))))))
+ (eglot--with-fixture
+ `(("project" . (("something.py" . "import sys\nsys.exi"))))
+ (with-current-buffer
+ (eglot--find-file-noselect "project/something.py")
+ (should (eglot--tests-connect))
+ (goto-char (point-max))
+ (completion-at-point)
+ (should (looking-back "sys.exit"))
+ (should (string-match "^exit" (eglot--tests-force-full-eldoc))))))
+
+(ert-deftest eglot-multiline-eldoc ()
+ "Test if suitable amount of lines of hover info are shown."
+ (skip-unless (executable-find "pyls"))
+ (eglot--with-fixture
+ `(("project" . (("hover-first.py" . "from datetime import datetime"))))
+ (with-current-buffer
+ (eglot--find-file-noselect "project/hover-first.py")
+ (should (eglot--tests-connect))
+ (goto-char (point-max))
+ ;; one-line
+ (let* ((eldoc-echo-area-use-multiline-p t)
+ (captured-message (eglot--tests-force-full-eldoc)))
+ (should (string-match "datetim" captured-message))
+ (should (cl-find ?\n eldoc-last-message))))))
-(ert-deftest hover-multiline-doc-locus ()
+(ert-deftest eglot-single-line-eldoc ()
"Test if suitable amount of lines of hover info are shown."
(skip-unless (executable-find "pyls"))
(eglot--with-fixture
- `(("project" . (("hover-first.py" . "from datetime import datetime")))
- (eglot-put-doc-in-help-buffer nil))
+ `(("project" . (("hover-first.py" . "from datetime import datetime"))))
(with-current-buffer
(eglot--find-file-noselect "project/hover-first.py")
(should (eglot--tests-connect))
(goto-char (point-max))
;; one-line
- (setq eldoc-last-message nil)
- (setq-local eldoc-echo-area-use-multiline-p nil)
- (eglot-eldoc-function)
- (while (not eldoc-last-message) (accept-process-output nil 0.1))
- (should (string-match "datetim" eldoc-last-message))
- (should (not (cl-find ?\n eldoc-last-message)))
- ;; multi-line
- (setq eldoc-last-message nil)
- (setq-local eldoc-echo-area-use-multiline-p t)
- (eglot-eldoc-function)
- (while (not eldoc-last-message) (accept-process-output nil 0.1))
- (should (string-match "datetim" eldoc-last-message))
- (should (cl-find ?\n eldoc-last-message)))))
+ (let* ((eldoc-echo-area-use-multiline-p nil)
+ (captured-message (eglot--tests-force-full-eldoc)))
+ (should (string-match "datetim" captured-message))
+ (should (not (cl-find ?\n eldoc-last-message)))))))
(ert-deftest python-autopep-formatting ()
"Test formatting in the pyls python LSP.
- [elpa] externals/elpa da7ff48 31/71: Fix #468: don't call flymake report function if flymake is disabled, (continued)
- [elpa] externals/elpa da7ff48 31/71: Fix #468: don't call flymake report function if flymake is disabled, João Távora, 2020/12/16
- [elpa] externals/elpa e514f9e 29/71: Close #461: make CI fail if byte compiler warns, João Távora, 2020/12/16
- [elpa] externals/elpa ffe79b9 34/71: Pin pyls to 0.31.10, João Távora, 2020/12/16
- [elpa] externals/elpa b0bfbfb 38/71: Fix #488: fix type error in eglot--xref-make-match, João Távora, 2020/12/16
- [elpa] externals/elpa 3634402 36/71: Fix #479: correctly place diagnostics in narrowed buffers, João Távora, 2020/12/16
- [elpa] externals/elpa e7a43e2 40/71: Fix #480: also consider label of a CompletionItem for snippets, João Távora, 2020/12/16
- [elpa] externals/elpa a807b4f 43/71: Some test-related cleanup, João Távora, 2020/12/16
- [elpa] externals/elpa 9874456 42/71: Close #482: use filter-buffer-substring to get buffer text, João Távora, 2020/12/16
- [elpa] externals/elpa b34447c 45/71: Close #473: simplify eglot-code-actions, João Távora, 2020/12/16
- [elpa] externals/elpa a044dec 47/71: Delegate "hover" and "signature" doc synchronization efforts to Eldoc, João Távora, 2020/12/16
- [elpa] externals/elpa a04b826 48/71: Update tests after update to newer Eldoc,
João Távora <=
- [elpa] externals/elpa 2b7ec0e 51/71: Expect eglot-multiline-eldoc to fail on Travis, João Távora, 2020/12/16
- [elpa] externals/elpa 6d96601 52/71: Closes #509: fix sorting of completion items, João Távora, 2020/12/16
- [elpa] externals/elpa 4e82f53 53/71: Reload Eldoc if needed on Emacs < 28, João Távora, 2020/12/16
- [elpa] externals/elpa 8c9219d 55/71: Unbreak tests after changes to eldoc.el, João Távora, 2020/12/16
- [elpa] externals/elpa ea82b4b 57/71: Close #505: ensure completion terminates in correct buffer, João Távora, 2020/12/16
- [elpa] externals/elpa fb6b17e 58/71: New 'make interactive' target for debuggable M-x ert, João Távora, 2020/12/16
- [elpa] externals/elpa 5f873d2 60/71: Fix #521: Correct paren mismatch blunder introduced by earlier commit, João Távora, 2020/12/16
- [elpa] externals/elpa 209b227 61/71: Fix #524: provide suitable default to M-x eglot-rename, João Távora, 2020/12/16
- [elpa] externals/elpa 61b71ea 62/71: Fix #528: unbreak Haskell's hie-wrapper built-in incantation, João Távora, 2020/12/16
- [elpa] externals/elpa af0e876 68/71: Close #572: use haskell-language-server in eglot-server-programs, João Távora, 2020/12/16