]> code.delx.au - gnu-emacs/blobdiff - test/automated/cl-lib-tests.el
Merge branch 'project-next'
[gnu-emacs] / test / automated / cl-lib-tests.el
index d6e6bef2db6652fa2145d4e9f78506b327fa0018..9b230db99e40867cf1429cf6eef41c55d23fec1c 100644 (file)
 
 (cl-defstruct (mystruct
                (:constructor cl-lib--con-1 (&aux (abc 1)))
-               (:constructor cl-lib--con-2 (&optional def)))
+               (:constructor cl-lib--con-2 (&optional def) "Constructor docstring."))
+  "General docstring."
   (abc 5 :readonly t) (def nil))
 (ert-deftest cl-lib-struct-accessors ()
   (let ((x (make-mystruct :abc 1 :def 2)))
               (`((cl-tag-slot) (abc 5 :readonly t)
                  (def . ,(or `nil `(nil))))
                t)))))
+(ert-deftest cl-lib-struct-constructors ()
+  (should (equal (documentation 'cl-lib--con-2 t)
+                 "Constructor docstring."))
+  (should (mystruct-p (cl-lib--con-1)))
+  (should (mystruct-p (cl-lib--con-2))))
 
 (ert-deftest cl-lib-arglist-performance ()
   ;; An `&aux' should not cause lambda's arglist to be turned into an &rest