diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-03-08 21:20:54 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-03-08 21:20:54 +0900 |
commit | 4dda6db3abf4a67455a007d28e14d62a9909f665 (patch) | |
tree | 88d4e316e81f5bdd8b6801ff89ea68cd164e4055 /test/lisp/emacs-lisp/checkdoc-tests.el | |
parent | 565995d408ca65ec9f981f175cca29d2164a5fd0 (diff) | |
parent | 432c1aaa80ce109250a93f50858a03ce3d01ca34 (diff) | |
download | emacs-4dda6db3abf4a67455a007d28e14d62a9909f665.tar.gz emacs-4dda6db3abf4a67455a007d28e14d62a9909f665.tar.bz2 emacs-4dda6db3abf4a67455a007d28e14d62a9909f665.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'test/lisp/emacs-lisp/checkdoc-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/checkdoc-tests.el | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el index cf7baf4ce44..7a7aa9fb3cd 100644 --- a/test/lisp/emacs-lisp/checkdoc-tests.el +++ b/test/lisp/emacs-lisp/checkdoc-tests.el @@ -52,49 +52,31 @@ (insert "(cl-defmethod foo ((a (eql smthg)) (b list)) \"Return A+B.\")") (checkdoc-defun))) -(ert-deftest checkdoc-cl-defun-with-key-ok () - "Checkdoc should be happy with a cl-defun using &key." - (with-temp-buffer - (emacs-lisp-mode) - (insert "(cl-defun foo (&key a (b 27)) \"Return :A+:B.\")") - (checkdoc-defun))) - -(ert-deftest checkdoc-cl-defun-with-allow-other-keys-ok () - "Checkdoc should be happy with a cl-defun using &allow-other-keys." - (with-temp-buffer - (emacs-lisp-mode) - (insert "(cl-defun foo (&key a &allow-other-keys) \"Return :A.\")") - (checkdoc-defun))) - -(ert-deftest checkdoc-cl-defun-with-default-optional-value-ok () - "Checkdoc should be happy with a cl-defun using default values for optional args." +(ert-deftest checkdoc-cl-defmethod-qualified-ok () + "Checkdoc should be happy with a `cl-defmethod' using qualifiers." (with-temp-buffer (emacs-lisp-mode) - ;; B is optional and equals 1+a if not provided. HAS-BS is non-nil - ;; if B was provided in the call: - (insert "(cl-defun foo (a &optional (b (1+ a) has-bs)) \"Return A + B.\")") + (insert "(cl-defmethod test :around ((a (eql smthg))) \"Return A.\")") (checkdoc-defun))) -(ert-deftest checkdoc-cl-defun-with-destructuring-ok () - "Checkdoc should be happy with a cl-defun destructuring its arguments." +(ert-deftest checkdoc-cl-defmethod-with-extra-qualifier-ok () + "Checkdoc should be happy with a :extra qualified `cl-defmethod'." (with-temp-buffer (emacs-lisp-mode) - (insert "(cl-defun foo ((a b &optional c) d) \"Return A+B+C+D.\")") - (checkdoc-defun))) + (insert "(cl-defmethod foo :extra \"foo\" ((a (eql smthg))) \"Return A.\")") + (checkdoc-defun)) -(ert-deftest checkdoc-cl-defmethod-ok () - "Checkdoc should be happy with a simple correct cl-defmethod." (with-temp-buffer (emacs-lisp-mode) - (insert "(cl-defmethod foo (a) \"Return A.\")") + (insert + "(cl-defmethod foo :extra \"foo\" :after ((a (eql smthg))) \"Return A.\")") (checkdoc-defun))) -(ert-deftest checkdoc-cl-defmethod-with-types-ok () - "Checkdoc should be happy with a cl-defmethod using types." +(ert-deftest checkdoc-cl-defmethod-with-extra-qualifier-and-nil-args-ok () + "Checkdoc should be happy with a 0-arity :extra qualified `cl-defmethod'." (with-temp-buffer (emacs-lisp-mode) - ;; this method matches if A is the symbol `smthg' and if b is a list: - (insert "(cl-defmethod foo ((a (eql smthg)) (b list)) \"Return A+B.\")") + (insert "(cl-defmethod foo :extra \"foo\" () \"Return A.\")") (checkdoc-defun))) (ert-deftest checkdoc-cl-defun-with-key-ok () |