summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/generator-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-02-14 21:31:06 -0500
committerNoam Postavsky <npostavs@gmail.com>2018-02-14 21:31:06 -0500
commit82379efaaf92e964875c0648b45bcae27b54d213 (patch)
tree3b23e3054d6ca0847bc2493041b81b57ced1fe01 /test/lisp/emacs-lisp/generator-tests.el
parent298275c595f6ca9e77f8131d34dda2b58fe1faa5 (diff)
downloademacs-82379efaaf92e964875c0648b45bcae27b54d213.tar.gz
; Add test for iter-lambda variable shadowing (Bug#26073)
* test/lisp/emacs-lisp/generator-tests.el (iter-lambda-variable-shadowing): New test.
Diffstat (limited to 'test/lisp/emacs-lisp/generator-tests.el')
-rw-r--r--test/lisp/emacs-lisp/generator-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/generator-tests.el b/test/lisp/emacs-lisp/generator-tests.el
index 9bf8413e159..bca3efa550b 100644
--- a/test/lisp/emacs-lisp/generator-tests.el
+++ b/test/lisp/emacs-lisp/generator-tests.el
@@ -292,3 +292,13 @@ identical output.
(i 0)
(j (setq i (1+ i))))
(iter-yield i))))))))
+
+(ert-deftest iter-lambda-variable-shadowing ()
+ "`iter-lambda' forms which have local variable shadowing (Bug#26073)."
+ (should (equal (iter-next
+ (funcall (iter-lambda ()
+ (let ((it 1))
+ (iter-yield (funcall
+ (lambda (it) (- it))
+ (1+ it)))))))
+ -2)))