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.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el
index 2a1d8b27636..a4b252031fe 100644
--- a/test/lisp/emacs-lisp/checkdoc-tests.el
+++ b/test/lisp/emacs-lisp/checkdoc-tests.el
@@ -122,4 +122,28 @@ See the comments in Bug#24998."
(should (looking-at-p "\"baz\")"))
(should-not (checkdoc-next-docstring))))
+(ert-deftest checkdoc-tests-in-abbrevation-p ()
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "foo bar e.g. baz")
+ (goto-char (point-min))
+ (re-search-forward "e.g")
+ (should (checkdoc-in-abbreviation-p (point)))))
+
+(ert-deftest checkdoc-tests-in-abbrevation-p/with-parens ()
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "foo bar (e.g. baz)")
+ (goto-char (point-min))
+ (re-search-forward "e.g")
+ (should (checkdoc-in-abbreviation-p (point)))))
+
+(ert-deftest checkdoc-tests-in-abbrevation-p/with-escaped-parens ()
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "foo\n\\(e.g. baz)")
+ (goto-char (point-min))
+ (re-search-forward "e.g")
+ (should (checkdoc-in-abbreviation-p (point)))))
+
;;; checkdoc-tests.el ends here