Fix misspelled functions in shortdoc groups
* lisp/emacs-lisp/shortdoc.el (file, list): Fix misspelled function names: 'file-writable-p' and 'seq-reduce'. * test/lisp/emacs-lisp/shortdoc-tests.el (subr-x): Require. (shortdoc-all-functions-fboundp): New test.
This commit is contained in:
parent
01acecc79c
commit
43c7e05a2a
2 changed files with 13 additions and 4 deletions
|
@ -421,8 +421,8 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
|
||||||
(file-readable-p
|
(file-readable-p
|
||||||
:no-eval (file-readable-p "/tmp/foo")
|
:no-eval (file-readable-p "/tmp/foo")
|
||||||
:eg-result t)
|
:eg-result t)
|
||||||
(file-writeable-p
|
(file-writable-p
|
||||||
:no-eval (file-writeable-p "/tmp/foo")
|
:no-eval (file-writable-p "/tmp/foo")
|
||||||
:eg-result t)
|
:eg-result t)
|
||||||
(file-accessible-directory-p
|
(file-accessible-directory-p
|
||||||
:no-eval (file-accessible-directory-p "/tmp")
|
:no-eval (file-accessible-directory-p "/tmp")
|
||||||
|
@ -652,8 +652,8 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
|
||||||
:eval (mapcan #'list '(1 2 3)))
|
:eval (mapcan #'list '(1 2 3)))
|
||||||
(mapc
|
(mapc
|
||||||
:eval (mapc #'insert '("1" "2" "3")))
|
:eval (mapc #'insert '("1" "2" "3")))
|
||||||
(reduce
|
(seq-reduce
|
||||||
:eval (reduce #'+ '(1 2 3)))
|
:eval (seq-reduce #'+ '(1 2 3) 0))
|
||||||
(mapconcat
|
(mapconcat
|
||||||
:eval (mapconcat #'identity '("foo" "bar") "|"))
|
:eval (mapconcat #'identity '("foo" "bar") "|"))
|
||||||
"Predicates"
|
"Predicates"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
(require 'ert)
|
(require 'ert)
|
||||||
(require 'shortdoc)
|
(require 'shortdoc)
|
||||||
|
(require 'subr-x) ; `string-pad' in shortdoc group needed at run time
|
||||||
|
|
||||||
(defun shortdoc-tests--tree-contains (tree fun)
|
(defun shortdoc-tests--tree-contains (tree fun)
|
||||||
"Whether TREE contains a call to FUN."
|
"Whether TREE contains a call to FUN."
|
||||||
|
@ -44,6 +45,14 @@
|
||||||
(should (shortdoc-tests--tree-contains expr fun))))
|
(should (shortdoc-tests--tree-contains expr fun))))
|
||||||
(setq props (cddr props))))))))
|
(setq props (cddr props))))))))
|
||||||
|
|
||||||
|
(ert-deftest shortdoc-all-functions-fboundp ()
|
||||||
|
"Check that all functions listed in shortdoc groups are `fboundp'."
|
||||||
|
(dolist (group shortdoc--groups)
|
||||||
|
(dolist (item group)
|
||||||
|
(when (consp item)
|
||||||
|
(let ((fun (car item)))
|
||||||
|
(should (fboundp fun)))))))
|
||||||
|
|
||||||
(ert-deftest shortdoc-all-groups-work ()
|
(ert-deftest shortdoc-all-groups-work ()
|
||||||
"Test that all defined shortdoc groups display correctly."
|
"Test that all defined shortdoc groups display correctly."
|
||||||
(dolist (group (mapcar (lambda (x) (car x)) shortdoc--groups))
|
(dolist (group (mapcar (lambda (x) (car x)) shortdoc--groups))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue