summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-12-15 23:20:25 -0500
committerNoam Postavsky <npostavs@gmail.com>2017-12-15 23:41:20 -0500
commit777fe9466168d935e9055c7592b943cd4d2d2ff9 (patch)
tree7ca50e3ebaa3c76da75f129ed8019324b6375267 /test/lisp
parentad17db7964a1022fb0f646b35a00ffc5fb70ec30 (diff)
downloademacs-777fe9466168d935e9055c7592b943cd4d2d2ff9.tar.gz
Partially revert "Mention new strictness for &optional, &rest..."
The changes to cl argument parsing are not backwards compatible, and cause inconvenience when writing macros (e.g., instead of doing '&aux ,@auxargs', some more complicated conditionals would be required). The `cl-defstruct' macro makes use of this convenience when defining empty structs (Bug#29728). * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): (cl--do-&aux, cl--do-arglist): Undo strict checking of &rest, &key, and &aux. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-bad-arglist): Remove test.
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el31
1 files changed, 0 insertions, 31 deletions
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index bf2e7e12759..575f170af6c 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -497,35 +497,4 @@ collection clause."
vconcat (vector (1+ x)))
[2 3 4 5 6])))
-
-;;; cl-lib lambda list handling
-
-(ert-deftest cl-macs-bad-arglist ()
- "Check that `cl-defun' and friends reject weird argument lists.
-See Bug#29165, and similar `eval-tests--bugs-24912-and-24913' in
-eval-tests.el."
- (dolist (args (cl-mapcan
- ;; For every &rest and &optional variant, check also
- ;; the same thing with &key and &aux respectively
- ;; instead.
- (lambda (arglist)
- (let ((arglists (list arglist)))
- (when (memq '&rest arglist)
- (push (cl-subst '&key '&rest arglist) arglists))
- (when (memq '&optional arglist)
- (push (cl-subst '&aux '&optional arglist) arglists))
- arglists))
- '((&optional) (&rest) (&optional &rest) (&rest &optional)
- (&optional &rest _a) (&optional _a &rest)
- (&rest _a &optional) (&rest &optional _a)
- (&optional &optional) (&optional &optional _a)
- (&optional _a &optional _b)
- (&rest &rest) (&rest &rest _a)
- (&rest _a &rest _b))))
- (ert-info ((prin1-to-string args) :prefix "arglist: ")
- (should-error (eval `(funcall (cl-function (lambda ,args))) t))
- (should-error (cl--transform-lambda (cons args t)))
- (let ((byte-compile-debug t))
- (should-error (eval `(byte-compile (cl-function (lambda ,args))) t))))))
-
;;; cl-macs-tests.el ends here