1
Fork 0
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:
Lars Ingebrigtsen 2021-09-21 20:30:57 +02:00
parent a08bb1f682
commit be4f858498
5 changed files with 35 additions and 0 deletions

View file

@ -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