summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/checkdoc-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/emacs-lisp/checkdoc-tests.el')
-rw-r--r--test/lisp/emacs-lisp/checkdoc-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el
index 18b5a499e08..02db88c17e2 100644
--- a/test/lisp/emacs-lisp/checkdoc-tests.el
+++ b/test/lisp/emacs-lisp/checkdoc-tests.el
@@ -37,4 +37,17 @@
(insert "(defun foo())")
(should-error (checkdoc-defun) :type 'user-error)))
+(ert-deftest checkdoc-tests--next-docstring ()
+ "Checks that the one-argument form of `defvar' works.
+See the comments in Bug#24998."
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "(defvar foo)
+\(defvar foo bar \"baz\")
+\(require 'foo)")
+ (goto-char (point-min))
+ (should (checkdoc-next-docstring))
+ (should (looking-at-p "\"baz\")"))
+ (should-not (checkdoc-next-docstring))))
+
;;; checkdoc-tests.el ends here