]> git.eshelyaron.com Git - emacs.git/commitdiff
; Silence byte-compiler
authorStefan Kangas <stefankangas@gmail.com>
Wed, 6 Sep 2023 11:00:30 +0000 (13:00 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 6 Sep 2023 12:15:00 +0000 (14:15 +0200)
* 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.

test/lisp/emacs-lisp/cl-lib-tests.el
test/lisp/progmodes/eglot-tests.el

index b14731c4d0a67ee16cf35be9064ecae04fa90017..0995e71db4ed4330d55287bf372ca7b9ea3b8103 100644 (file)
 
 (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))
index 725b877fd3ca9c2ce8a9d08c27589ceed69ab65d..575a6ac8ef1c806899726ed8bdbdca91287720e6 100644 (file)
@@ -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."