(file-readable-p
:no-eval (file-readable-p "/tmp/foo")
:eg-result t)
- (file-writeable-p
- :no-eval (file-writeable-p "/tmp/foo")
+ (file-writable-p
+ :no-eval (file-writable-p "/tmp/foo")
:eg-result t)
(file-accessible-directory-p
:no-eval (file-accessible-directory-p "/tmp")
:eval (mapcan #'list '(1 2 3)))
(mapc
:eval (mapc #'insert '("1" "2" "3")))
- (reduce
- :eval (reduce #'+ '(1 2 3)))
+ (seq-reduce
+ :eval (seq-reduce #'+ '(1 2 3) 0))
(mapconcat
:eval (mapconcat #'identity '("foo" "bar") "|"))
"Predicates"
(require 'ert)
(require 'shortdoc)
+(require 'subr-x) ; `string-pad' in shortdoc group needed at run time
(defun shortdoc-tests--tree-contains (tree fun)
"Whether TREE contains a call to FUN."
(should (shortdoc-tests--tree-contains expr fun))))
(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 ()
"Test that all defined shortdoc groups display correctly."
(dolist (group (mapcar (lambda (x) (car x)) shortdoc--groups))