From 7055e47cde4d18b50ef11a1422a64d69f8a550a2 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 6 Sep 2023 13:00:30 +0200 Subject: [PATCH] ; 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. --- test/lisp/emacs-lisp/cl-lib-tests.el | 36 +++++++++++++++------------- test/lisp/progmodes/eglot-tests.el | 18 +++++++------- 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 @@ (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)) 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." (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." -- 2.39.5