summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/cl-lib-tests.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2017-04-01 12:11:07 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2017-04-01 12:11:07 -0400
commitacce29d6c57f66646190595b5b9427602fc4a7fd (patch)
tree12c043828f997c6bfd8c29a99fcd832bd4a2cf27 /test/lisp/emacs-lisp/cl-lib-tests.el
parent9cf6a408c8f1678dc4a53f722aa1984c9489b4c2 (diff)
downloademacs-acce29d6c57f66646190595b5b9427602fc4a7fd.tar.gz
* 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.
Diffstat (limited to 'test/lisp/emacs-lisp/cl-lib-tests.el')
-rw-r--r--test/lisp/emacs-lisp/cl-lib-tests.el25
1 files changed, 21 insertions, 4 deletions
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