* lisp/subr.el (list-of-strings-p): New function.
Otherwise, return nil."
(or (stringp object) (null object)))
+(defun list-of-strings-p (object)
+ "Return t if OBJECT is nil or a list of strings."
+ (and (listp object)
+ (seq-every-p #'stringp object)))
+
(defun booleanp (object)
"Return t if OBJECT is one of the two canonical boolean values: t or nil.
Otherwise, return nil."
(should (equal (butlast l n)
(subr-tests--butlast-ref l n))))))
+(ert-deftest test-list-of-strings-p ()
+ (should-not (list-of-strings-p 1))
+ (should (list-of-strings-p nil))
+ (should (list-of-strings-p '("a" "b")))
+ (should-not (list-of-strings-p ["a" "b"]))
+ (should-not (list-of-strings-p '("a" nil "b"))))
+
(provide 'subr-tests)
;;; subr-tests.el ends here