(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))
(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 ()
(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
: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))
(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."