From: Stefan Monnier Date: Sat, 1 Apr 2017 16:11:07 +0000 (-0400) Subject: * test/lisp/emacs-lisp/cl-lib-tests.el: Improve symbol-macrolet tests X-Git-Tag: emacs-26.0.90~522^2~4^2~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=acce29d6c57f66646190595b5b9427602fc4a7fd;p=emacs.git * test/lisp/emacs-lisp/cl-lib-tests.el: Improve symbol-macrolet tests (cl-lib-symbol-macrolet): Fix last test so it doesn't break the whole test suite. (cl-lib-symbol-macrolet-2): New test. --- diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index b5946208f10..093cb3476c1 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -494,12 +494,29 @@ (should-not (cl-typep 1 'cl-lib-test-type))) (ert-deftest cl-lib-symbol-macrolet () + ;; bug#26325 + :expected-result :failed (should (equal (cl-flet ((f (x) (+ x 5))) (let ((x 5)) (f (+ x 6)))) - (cl-symbol-macrolet ((f (+ x 6))) - (cl-flet ((f (x) (+ x 5))) - (let ((x 5)) - (f f))))))) + ;; Go through `eval', otherwise the macro-expansion + ;; error prevents running the whole test suite :-( + (eval '(cl-symbol-macrolet ((f (+ x 6))) + (cl-flet ((f (x) (+ x 5))) + (let ((x 5)) + (f f)))) + t)))) + +(defmacro cl-lib-symbol-macrolet-4+5 () + ;; bug#26068 + (let* ((sname "x") + (s1 (make-symbol sname)) + (s2 (make-symbol sname))) + `(cl-symbol-macrolet ((,s1 4) + (,s2 5)) + (+ ,s1 ,s2)))) + +(ert-deftest cl-lib-symbol-macrolet-2 () + (should (equal (cl-lib-symbol-macrolet-4+5) (+ 4 5)))) ;;; cl-lib.el ends here