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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 124a833 56/69: Add a test for #311 and #279


From: João Távora
Subject: [elpa] externals/eglot 124a833 56/69: Add a test for #311 and #279
Date: Sun, 20 Oct 2019 08:21:52 -0400 (EDT)

branch: externals/eglot
commit 124a8336b2102f62f32e3f3475f51c78e0492062
Author: Felicián Németh <address@hidden>
Commit: João Távora <address@hidden>

    Add a test for #311 and #279
    
    * eglot-tests.el (snippet-completions): New test.
---
 Makefile       |  1 +
 eglot-tests.el | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Makefile b/Makefile
index 9f4ed1a..fce089c 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ ELCFILES := $(ELFILES:.el=.elc)
 ELPADEPS ?=--eval '(package-initialize)'                       \
            --eval '(package-refresh-contents)'                 \
            --eval '(package-install (quote jsonrpc))'          \
+           --eval '(package-install (quote yasnippet))'                \
            --eval '(package-install                            \
                       (cadr (assoc (quote flymake)             \
                                    package-archive-contents)))'
diff --git a/eglot-tests.el b/eglot-tests.el
index c01c699..2d9f783 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -461,6 +461,20 @@ Pass TIMEOUT to `eglot--with-timeout'."
       (call-interactively 'xref-find-definitions)
       (should (looking-at "foo(): pass")))))
 
+(ert-deftest snippet-completions ()
+  "Test simple snippet completion in a python LSP"
+  (skip-unless (and (executable-find "pyls")
+                    (functionp 'yas-minor-mode)))
+  (eglot--with-fixture
+      '(("project" . (("something.py" . "setatt"))))
+    (with-current-buffer
+        (eglot--find-file-noselect "project/something.py")
+      (yas-minor-mode 1)
+      (should (eglot--tests-connect))
+      (goto-char (point-max))
+      (completion-at-point)
+      (should (looking-back "setattr(")))))
+
 (ert-deftest hover-after-completions ()
   "Test documentation echo in a python LSP"
   (skip-unless (executable-find "pyls"))



reply via email to

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