emacs-elpa-diffs
[Top][All Lists]
Advanced

[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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]