mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Add new function `ensure-list'
* doc/lispref/lists.texi (Building Lists): Document it. * lisp/subr.el (ensure-list): New function. * lisp/emacs-lisp/shortdoc.el (list): Mention it.
This commit is contained in:
parent
a08bb1f682
commit
be4f858498
5 changed files with 35 additions and 0 deletions
|
|
@ -767,5 +767,10 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
|
|||
(should-not (equal dir default-directory))
|
||||
(should (file-exists-p default-directory)))))
|
||||
|
||||
(ert-deftest test-ensure-list ()
|
||||
(should (equal (ensure-list nil) nil))
|
||||
(should (equal (ensure-list :foo) '(:foo)))
|
||||
(should (equal (ensure-list '(1 2 3)) '(1 2 3))))
|
||||
|
||||
(provide 'subr-tests)
|
||||
;;; subr-tests.el ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue