aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2023-09-06 13:00:30 +0200
committerStefan Kangas2023-09-06 14:15:00 +0200
commit7055e47cde4d18b50ef11a1422a64d69f8a550a2 (patch)
tree656343152bdf5e5f35a939d9a01f4fc88592b5b5 /test
parentd3e650d33709c6323b9e2346a951d5eb5ff82b44 (diff)
downloademacs-7055e47cde4d18b50ef11a1422a64d69f8a550a2.tar.gz
emacs-7055e47cde4d18b50ef11a1422a64d69f8a550a2.zip
; 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.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/cl-lib-tests.el36
-rw-r--r--test/lisp/progmodes/eglot-tests.el18
2 files changed, 28 insertions, 26 deletions
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el
index b14731c4d0a..0995e71db4e 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -530,27 +530,29 @@
530 530
531(ert-deftest old-struct () 531(ert-deftest old-struct ()
532 (cl-defstruct foo x) 532 (cl-defstruct foo x)
533 (let ((x (vector 'cl-struct-foo)) 533 (with-suppressed-warnings ((obsolete cl-old-struct-compat-mode))
534 (saved cl-old-struct-compat-mode)) 534 (let ((x (vector 'cl-struct-foo))
535 (cl-old-struct-compat-mode -1) 535 (saved cl-old-struct-compat-mode))
536 (should (eq (type-of x) 'vector)) 536 (cl-old-struct-compat-mode -1)
537 (should (eq (type-of x) 'vector))
537 538
538 (cl-old-struct-compat-mode 1) 539 (cl-old-struct-compat-mode 1)
539 (defvar cl-struct-foo) 540 (defvar cl-struct-foo)
540 (let ((cl-struct-foo (cl--struct-get-class 'foo))) 541 (let ((cl-struct-foo (cl--struct-get-class 'foo)))
541 (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check) 542 (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check)
542 (should (eq (type-of x) 'foo)) 543 (should (eq (type-of x) 'foo))
543 (should (eq (type-of (vector 'foo)) 'vector))) 544 (should (eq (type-of (vector 'foo)) 'vector)))
544 545
545 (cl-old-struct-compat-mode (if saved 1 -1)))) 546 (cl-old-struct-compat-mode (if saved 1 -1)))))
546 547
547(ert-deftest cl-lib-old-struct () 548(ert-deftest cl-lib-old-struct ()
548 (let ((saved cl-old-struct-compat-mode)) 549 (with-suppressed-warnings ((obsolete cl-old-struct-compat-mode))
549 (cl-old-struct-compat-mode -1) 550 (let ((saved cl-old-struct-compat-mode))
550 (cl-struct-define 'foo "" 'cl-structure-object nil nil nil 551 (cl-old-struct-compat-mode -1)
551 'cl-struct-foo-tags 'cl-struct-foo t) 552 (cl-struct-define 'foo "" 'cl-structure-object nil nil nil
552 (should cl-old-struct-compat-mode) 553 'cl-struct-foo-tags 'cl-struct-foo t)
553 (cl-old-struct-compat-mode (if saved 1 -1)))) 554 (should cl-old-struct-compat-mode)
555 (cl-old-struct-compat-mode (if saved 1 -1)))))
554 556
555(ert-deftest cl-constantly () 557(ert-deftest cl-constantly ()
556 (should (equal (mapcar (cl-constantly 3) '(a b c d)) 558 (should (equal (mapcar (cl-constantly 3) '(a b c d))
diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
index 725b877fd3c..575a6ac8ef1 100644
--- a/test/lisp/progmodes/eglot-tests.el
+++ b/test/lisp/progmodes/eglot-tests.el
@@ -415,7 +415,7 @@ directory hierarchy."
415 (and (string= method "workspace/didChangeWatchedFiles") 415 (and (string= method "workspace/didChangeWatchedFiles")
416 (cl-destructuring-bind (&key uri type) 416 (cl-destructuring-bind (&key uri type)
417 (elt (plist-get params :changes) 0) 417 (elt (plist-get params :changes) 0)
418 (and (string= (eglot--path-to-uri "Cargo.toml") uri) 418 (and (string= (eglot-path-to-uri "Cargo.toml") uri)
419 (= type 3)))))))))) 419 (= type 3))))))))))
420 420
421(ert-deftest eglot-test-basic-diagnostics () 421(ert-deftest eglot-test-basic-diagnostics ()
@@ -927,7 +927,7 @@ int main() {
927 (should-error (apply #'eglot--connect (eglot--guess-contact))))))) 927 (should-error (apply #'eglot--connect (eglot--guess-contact)))))))
928 928
929(ert-deftest eglot-test-capabilities () 929(ert-deftest eglot-test-capabilities ()
930 "Unit test for `eglot--server-capable'." 930 "Unit test for `eglot-server-capable'."
931 (cl-letf (((symbol-function 'eglot--capabilities) 931 (cl-letf (((symbol-function 'eglot--capabilities)
932 (lambda (_dummy) 932 (lambda (_dummy)
933 ;; test data lifted from Golangserver example at 933 ;; test data lifted from Golangserver example at
@@ -942,11 +942,11 @@ int main() {
942 :xdefinitionProvider t :xworkspaceSymbolByProperties t))) 942 :xdefinitionProvider t :xworkspaceSymbolByProperties t)))
943 ((symbol-function 'eglot--current-server-or-lose) 943 ((symbol-function 'eglot--current-server-or-lose)
944 (lambda () nil))) 944 (lambda () nil)))
945 (should (eql 2 (eglot--server-capable :textDocumentSync))) 945 (should (eql 2 (eglot-server-capable :textDocumentSync)))
946 (should (eglot--server-capable :completionProvider :triggerCharacters)) 946 (should (eglot-server-capable :completionProvider :triggerCharacters))
947 (should (equal '(:triggerCharacters ["."]) (eglot--server-capable :completionProvider))) 947 (should (equal '(:triggerCharacters ["."]) (eglot-server-capable :completionProvider)))
948 (should-not (eglot--server-capable :foobarbaz)) 948 (should-not (eglot-server-capable :foobarbaz))
949 (should-not (eglot--server-capable :textDocumentSync :foobarbaz)))) 949 (should-not (eglot-server-capable :textDocumentSync :foobarbaz))))
950 950
951(defmacro eglot--without-interface-warnings (&rest body) 951(defmacro eglot--without-interface-warnings (&rest body)
952 (let ((eglot-strict-mode nil)) 952 (let ((eglot-strict-mode nil))
@@ -1276,9 +1276,9 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of
1276(ert-deftest eglot-test-path-to-uri-windows () 1276(ert-deftest eglot-test-path-to-uri-windows ()
1277 (skip-unless (eq system-type 'windows-nt)) 1277 (skip-unless (eq system-type 'windows-nt))
1278 (should (string-prefix-p "file:///" 1278 (should (string-prefix-p "file:///"
1279 (eglot--path-to-uri "c:/Users/Foo/bar.lisp"))) 1279 (eglot-path-to-uri "c:/Users/Foo/bar.lisp")))
1280 (should (string-suffix-p "c%3A/Users/Foo/bar.lisp" 1280 (should (string-suffix-p "c%3A/Users/Foo/bar.lisp"
1281 (eglot--path-to-uri "c:/Users/Foo/bar.lisp")))) 1281 (eglot-path-to-uri "c:/Users/Foo/bar.lisp"))))
1282 1282
1283(ert-deftest eglot-test-same-server-multi-mode () 1283(ert-deftest eglot-test-same-server-multi-mode ()
1284 "Check single LSP instance manages multiple modes in same project." 1284 "Check single LSP instance manages multiple modes in same project."