; Silence byte-compiler
* test/lisp/emacs-lisp/cl-lib-tests.el (old-struct) (cl-lib-old-struct): * test/lisp/progmodes/eglot-tests.el (eglot-test-rust-analyzer-watches-files) (eglot-test-capabilities, eglot-test-path-to-uri-windows): Silence byte-compiler.
This commit is contained in:
parent
d3e650d337
commit
7055e47cde
2 changed files with 28 additions and 26 deletions
|
@ -530,27 +530,29 @@
|
|||
|
||||
(ert-deftest old-struct ()
|
||||
(cl-defstruct foo x)
|
||||
(let ((x (vector 'cl-struct-foo))
|
||||
(saved cl-old-struct-compat-mode))
|
||||
(cl-old-struct-compat-mode -1)
|
||||
(should (eq (type-of x) 'vector))
|
||||
(with-suppressed-warnings ((obsolete cl-old-struct-compat-mode))
|
||||
(let ((x (vector 'cl-struct-foo))
|
||||
(saved cl-old-struct-compat-mode))
|
||||
(cl-old-struct-compat-mode -1)
|
||||
(should (eq (type-of x) 'vector))
|
||||
|
||||
(cl-old-struct-compat-mode 1)
|
||||
(defvar cl-struct-foo)
|
||||
(let ((cl-struct-foo (cl--struct-get-class 'foo)))
|
||||
(setf (symbol-function 'cl-struct-foo) :quick-object-witness-check)
|
||||
(should (eq (type-of x) 'foo))
|
||||
(should (eq (type-of (vector 'foo)) 'vector)))
|
||||
(cl-old-struct-compat-mode 1)
|
||||
(defvar cl-struct-foo)
|
||||
(let ((cl-struct-foo (cl--struct-get-class 'foo)))
|
||||
(setf (symbol-function 'cl-struct-foo) :quick-object-witness-check)
|
||||
(should (eq (type-of x) 'foo))
|
||||
(should (eq (type-of (vector 'foo)) 'vector)))
|
||||
|
||||
(cl-old-struct-compat-mode (if saved 1 -1))))
|
||||
(cl-old-struct-compat-mode (if saved 1 -1)))))
|
||||
|
||||
(ert-deftest cl-lib-old-struct ()
|
||||
(let ((saved cl-old-struct-compat-mode))
|
||||
(cl-old-struct-compat-mode -1)
|
||||
(cl-struct-define 'foo "" 'cl-structure-object nil nil nil
|
||||
'cl-struct-foo-tags 'cl-struct-foo t)
|
||||
(should cl-old-struct-compat-mode)
|
||||
(cl-old-struct-compat-mode (if saved 1 -1))))
|
||||
(with-suppressed-warnings ((obsolete cl-old-struct-compat-mode))
|
||||
(let ((saved cl-old-struct-compat-mode))
|
||||
(cl-old-struct-compat-mode -1)
|
||||
(cl-struct-define 'foo "" 'cl-structure-object nil nil nil
|
||||
'cl-struct-foo-tags 'cl-struct-foo t)
|
||||
(should cl-old-struct-compat-mode)
|
||||
(cl-old-struct-compat-mode (if saved 1 -1)))))
|
||||
|
||||
(ert-deftest cl-constantly ()
|
||||
(should (equal (mapcar (cl-constantly 3) '(a b c d))
|
||||
|
|
|
@ -415,7 +415,7 @@ directory hierarchy."
|
|||
(and (string= method "workspace/didChangeWatchedFiles")
|
||||
(cl-destructuring-bind (&key uri type)
|
||||
(elt (plist-get params :changes) 0)
|
||||
(and (string= (eglot--path-to-uri "Cargo.toml") uri)
|
||||
(and (string= (eglot-path-to-uri "Cargo.toml") uri)
|
||||
(= type 3))))))))))
|
||||
|
||||
(ert-deftest eglot-test-basic-diagnostics ()
|
||||
|
@ -927,7 +927,7 @@ int main() {
|
|||
(should-error (apply #'eglot--connect (eglot--guess-contact)))))))
|
||||
|
||||
(ert-deftest eglot-test-capabilities ()
|
||||
"Unit test for `eglot--server-capable'."
|
||||
"Unit test for `eglot-server-capable'."
|
||||
(cl-letf (((symbol-function 'eglot--capabilities)
|
||||
(lambda (_dummy)
|
||||
;; test data lifted from Golangserver example at
|
||||
|
@ -942,11 +942,11 @@ int main() {
|
|||
:xdefinitionProvider t :xworkspaceSymbolByProperties t)))
|
||||
((symbol-function 'eglot--current-server-or-lose)
|
||||
(lambda () nil)))
|
||||
(should (eql 2 (eglot--server-capable :textDocumentSync)))
|
||||
(should (eglot--server-capable :completionProvider :triggerCharacters))
|
||||
(should (equal '(:triggerCharacters ["."]) (eglot--server-capable :completionProvider)))
|
||||
(should-not (eglot--server-capable :foobarbaz))
|
||||
(should-not (eglot--server-capable :textDocumentSync :foobarbaz))))
|
||||
(should (eql 2 (eglot-server-capable :textDocumentSync)))
|
||||
(should (eglot-server-capable :completionProvider :triggerCharacters))
|
||||
(should (equal '(:triggerCharacters ["."]) (eglot-server-capable :completionProvider)))
|
||||
(should-not (eglot-server-capable :foobarbaz))
|
||||
(should-not (eglot-server-capable :textDocumentSync :foobarbaz))))
|
||||
|
||||
(defmacro eglot--without-interface-warnings (&rest body)
|
||||
(let ((eglot-strict-mode nil))
|
||||
|
@ -1276,9 +1276,9 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of
|
|||
(ert-deftest eglot-test-path-to-uri-windows ()
|
||||
(skip-unless (eq system-type 'windows-nt))
|
||||
(should (string-prefix-p "file:///"
|
||||
(eglot--path-to-uri "c:/Users/Foo/bar.lisp")))
|
||||
(eglot-path-to-uri "c:/Users/Foo/bar.lisp")))
|
||||
(should (string-suffix-p "c%3A/Users/Foo/bar.lisp"
|
||||
(eglot--path-to-uri "c:/Users/Foo/bar.lisp"))))
|
||||
(eglot-path-to-uri "c:/Users/Foo/bar.lisp"))))
|
||||
|
||||
(ert-deftest eglot-test-same-server-multi-mode ()
|
||||
"Check single LSP instance manages multiple modes in same project."
|
||||
|
|
Loading…
Add table
Reference in a new issue