summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/cconv-tests.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-12-20 11:04:37 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-12-20 22:00:57 -0500
commit0c4fc7032ab32fb639c188d9647eb132d55adfa5 (patch)
tree0f2aad5df7f157301e13a089c5cebf7a09d4d209 /test/lisp/emacs-lisp/cconv-tests.el
parent43356423a285d41ce3edc00c3ed115b184e2c720 (diff)
downloademacs-0c4fc7032ab32fb639c188d9647eb132d55adfa5.tar.gz
Fix bug#28557
* test/lisp/emacs-lisp/cconv-tests.el: Remove `:expected-result :failed` from the bug#28557 tests. (cconv-tests-cl-function-:documentation): Account for the presence of the arglist (aka "usage") in the docstring. * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Handle non-constant `:documentation`. * lisp/emacs-lisp/generator.el (iter-lambda): * lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): Use `macroexp-parse-body`.
Diffstat (limited to 'test/lisp/emacs-lisp/cconv-tests.el')
-rw-r--r--test/lisp/emacs-lisp/cconv-tests.el39
1 files changed, 13 insertions, 26 deletions
diff --git a/test/lisp/emacs-lisp/cconv-tests.el b/test/lisp/emacs-lisp/cconv-tests.el
index 94bc759fa07..479afe12c0d 100644
--- a/test/lisp/emacs-lisp/cconv-tests.el
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -23,6 +23,7 @@
(require 'ert)
(require 'cl-lib)
+(require 'generator)
(ert-deftest cconv-tests-lambda-:documentation ()
"Docstring for lambda can be specified with :documentation."
@@ -83,9 +84,6 @@
(iter-yield 'cl-iter-defun-result))
(ert-deftest cconv-tests-cl-iter-defun-:documentation ()
"Docstring for cl-iter-defun can be specified with :documentation."
- ;; FIXME: See Bug#28557.
- :tags '(:unstable)
- :expected-result :failed
(should (string= (documentation 'cconv-tests-cl-iter-defun)
"cl-iter-defun documentation"))
(should (eq (iter-next (cconv-tests-cl-iter-defun))
@@ -96,36 +94,27 @@
(iter-yield 'iter-defun-result))
(ert-deftest cconv-tests-iter-defun-:documentation ()
"Docstring for iter-defun can be specified with :documentation."
- ;; FIXME: See Bug#28557.
- :tags '(:unstable)
- :expected-result :failed
(should (string= (documentation 'cconv-tests-iter-defun)
"iter-defun documentation"))
(should (eq (iter-next (cconv-tests-iter-defun)) 'iter-defun-result)))
(ert-deftest cconv-tests-iter-lambda-:documentation ()
"Docstring for iter-lambda can be specified with :documentation."
- ;; FIXME: See Bug#28557.
- :expected-result :failed
- (with-no-warnings ; disable warnings for now as test is expected to fail
- (let ((iter-fun
- (iter-lambda ()
- (:documentation (concat "iter-lambda" " documentation"))
- (iter-yield 'iter-lambda-result))))
- (should (string= (documentation iter-fun) "iter-lambda documentation"))
- (should (eq (iter-next (funcall iter-fun)) 'iter-lambda-result)))))
+ (let ((iter-fun
+ (iter-lambda ()
+ (:documentation (concat "iter-lambda" " documentation"))
+ (iter-yield 'iter-lambda-result))))
+ (should (string= (documentation iter-fun) "iter-lambda documentation"))
+ (should (eq (iter-next (funcall iter-fun)) 'iter-lambda-result))))
(ert-deftest cconv-tests-cl-function-:documentation ()
"Docstring for cl-function can be specified with :documentation."
- ;; FIXME: See Bug#28557.
- :expected-result :failed
- (with-no-warnings ; disable warnings for now as test is expected to fail
- (let ((fun (cl-function (lambda (&key arg)
- (:documentation (concat "cl-function"
- " documentation"))
- (list arg 'cl-function-result)))))
- (should (string= (documentation fun) "cl-function documentation"))
- (should (equal (funcall fun :arg t) '(t cl-function-result))))))
+ (let ((fun (cl-function (lambda (&key arg)
+ (:documentation (concat "cl-function"
+ " documentation"))
+ (list arg 'cl-function-result)))))
+ (should (string-match "\\`cl-function documentation$" (documentation fun)))
+ (should (equal (funcall fun :arg t) '(t cl-function-result)))))
(ert-deftest cconv-tests-function-:documentation ()
"Docstring for lambda inside function can be specified with :documentation."
@@ -144,8 +133,6 @@
(+ 1 n))
(ert-deftest cconv-tests-cl-defgeneric-:documentation ()
"Docstring for cl-defgeneric can be specified with :documentation."
- ;; FIXME: See Bug#28557.
- :expected-result :failed
(let ((descr (describe-function 'cconv-tests-cl-defgeneric)))
(set-text-properties 0 (length descr) nil descr)
(should (string-match-p "cl-defgeneric documentation" descr))