[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 5e3804b 20/24: Add a new test.
From: |
João Távora |
Subject: |
[elpa] externals/eglot 5e3804b 20/24: Add a new test. |
Date: |
Sat, 26 May 2018 14:31:18 -0400 (EDT) |
branch: externals/eglot
commit 5e3804b9844f34bc4e190df92693263b379cb84d
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Add a new test.
* eglot-tests.el (rls-hover-after-edit): Simplify.
(rls-rename): New test.
(rls-watches-files, rls-basic-diagnostics)
(rls-hover-after-edit): Rename temp dir for better debugging.
---
eglot-tests.el | 42 ++++++++++++++++++++++++++++++++++--------
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/eglot-tests.el b/eglot-tests.el
index dab5aa6..3987c7c 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -235,11 +235,11 @@ Pass TIMEOUT to `eglot--with-timeout'."
(skip-unless (null (getenv "TRAVIS_TESTING")))
(let ((eglot-autoreconnect 1))
(eglot--with-dirs-and-files
- '(("project" . (("coiso.rs" . "bla")
- ("merdix.rs" . "bla"))))
+ '(("watch-project" . (("coiso.rs" . "bla")
+ ("merdix.rs" . "bla"))))
(eglot--with-timeout 10
(with-current-buffer
- (eglot--find-file-noselect "project/coiso.rs")
+ (eglot--find-file-noselect "watch-project/coiso.rs")
(should (zerop (shell-command "cargo init")))
(eglot--sniffing (
:server-requests s-requests
@@ -270,10 +270,10 @@ Pass TIMEOUT to `eglot--with-timeout'."
(skip-unless (executable-find "rls"))
(skip-unless (executable-find "cargo"))
(eglot--with-dirs-and-files
- '(("project" . (("main.rs" . "bla"))))
+ '(("diag-project" . (("main.rs" . "bla"))))
(eglot--with-timeout 3
(with-current-buffer
- (eglot--find-file-noselect "project/main.rs")
+ (eglot--find-file-noselect "diag-project/main.rs")
(should (zerop (shell-command "cargo init")))
(eglot--sniffing (:server-notifications s-notifs)
(insert "fn main() {\nprintfoo!(\"Hello, world!\");\n}")
@@ -289,10 +289,12 @@ Pass TIMEOUT to `eglot--with-timeout'."
(skip-unless (executable-find "rls"))
(skip-unless (executable-find "cargo"))
(eglot--with-dirs-and-files
- '(("project" . (("main.rs" . "bla"))))
+ '(("hover-project" .
+ (("main.rs" .
+ "fn test() -> i32 { let test=3; return te; }"))))
(eglot--with-timeout 3
(with-current-buffer
- (eglot--find-file-noselect "project/main.rs")
+ (eglot--find-file-noselect "hover-project/main.rs")
(should (zerop (shell-command "cargo init")))
(eglot--sniffing (
:server-notifications s-notifs
@@ -302,7 +304,6 @@ Pass TIMEOUT to `eglot--with-timeout'."
:client-replies c-replies
:client-requests c-reqs
)
- (insert "fn test() -> i32 { let test=3; return te; }")
(apply #'eglot (eglot--interactive))
(goto-char (point-min))
(search-forward "return te")
@@ -321,6 +322,31 @@ Pass TIMEOUT to `eglot--with-timeout'."
(&key id &allow-other-keys)
(eq id pending-id))))))))
+(ert-deftest rls-rename ()
+ "Test renaming in RLS."
+ (skip-unless (executable-find "rls"))
+ (skip-unless (executable-find "cargo"))
+ (eglot--with-dirs-and-files
+ '(("rename-project"
+ . (("main.rs" .
+ "fn test() -> i32 { let test=3; return test; }"))))
+ (eglot--with-timeout 3
+ (with-current-buffer
+ (eglot--find-file-noselect "rename-project/main.rs")
+ (should (zerop (shell-command "cargo init")))
+ (eglot--sniffing (
+ :server-notifications s-notifs
+ :server-requests s-requests
+ :server-replies s-replies
+ :client-notifications c-notifs
+ :client-replies c-replies
+ :client-requests c-reqs
+ )
+ (apply #'eglot (eglot--interactive))
+ (goto-char (point-min)) (search-forward "return te")
+ (eglot-rename "bla")
+ (should (equal (buffer-string) "fn test() -> i32 { let bla=3; return
bla; }")))))))
+
(ert-deftest basic-completions ()
"Test basic autocompletion in a python LSP"
(skip-unless (executable-find "pyls"))
- [elpa] externals/eglot 07078da 08/24: Rework eglot-tests.el for better debuggability, (continued)
- [elpa] externals/eglot 07078da 08/24: Rework eglot-tests.el for better debuggability, João Távora, 2018/05/26
- [elpa] externals/eglot 0462130 15/24: New RLS tests, João Távora, 2018/05/26
- [elpa] externals/eglot e1d7ff3 09/24: Disable file-watching tests on Travis, João Távora, 2018/05/26
- [elpa] externals/eglot c8e7ab0 16/24: Don't rely on Flymake's idle timer for textDocument/didChange, João Távora, 2018/05/26
- [elpa] externals/eglot 99ca690 17/24: Simpify eglot--server-receive, João Távora, 2018/05/26
- [elpa] externals/eglot 1b5ed29 21/24: Really ensure eglot--shutdown deletes a process completely, João Távora, 2018/05/26
- [elpa] externals/eglot 897cbc3 24/24: * eglot.el (Version): Bump to 0.5, João Távora, 2018/05/26
- [elpa] externals/eglot ec10de2 23/24: Another unstable test on Travis, João Távora, 2018/05/26
- [elpa] externals/eglot d0fb9d2 22/24: Merge branch 'cquery-support' into master, João Távora, 2018/05/26
- [elpa] externals/eglot 97db670 19/24: Get rid of eglot--obj, an uninteresting abstraction, João Távora, 2018/05/26
- [elpa] externals/eglot 5e3804b 20/24: Add a new test.,
João Távora <=
- [elpa] externals/eglot 94c008d 18/24: Cleanup deferred request mechanism with a readable log, João Távora, 2018/05/26
- [elpa] externals/eglot 18176f3 02/24: Use an EIEIO class to represent a server., João Távora, 2018/05/26
- [elpa] externals/eglot eccb7d1 10/24: Merge branch 'use-eieio-server-defclass', João Távora, 2018/05/26