Skip to content

Commit

Permalink
Add test to joaotavora#311 and joaotavora#279
Browse files Browse the repository at this point in the history
* eglot-tests.el (snippet-completions): New test.
  • Loading branch information
nemethf committed Oct 6, 2019
1 parent 74a42ab commit 689e73d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)))'
Expand Down
14 changes: 14 additions & 0 deletions eglot-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,20 @@ Pass TIMEOUT to `eglot--with-timeout'."
(completion-at-point)
(should (looking-back "sys.exit")))))

(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"))
Expand Down

0 comments on commit 689e73d

Please sign in to comment.