aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNoam Postavsky2018-02-14 21:31:06 -0500
committerNoam Postavsky2018-02-14 21:31:06 -0500
commit82379efaaf92e964875c0648b45bcae27b54d213 (patch)
tree3b23e3054d6ca0847bc2493041b81b57ced1fe01 /test
parent298275c595f6ca9e77f8131d34dda2b58fe1faa5 (diff)
downloademacs-82379efaaf92e964875c0648b45bcae27b54d213.tar.gz
emacs-82379efaaf92e964875c0648b45bcae27b54d213.zip
; 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')
-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.
292 (i 0) 292 (i 0)
293 (j (setq i (1+ i)))) 293 (j (setq i (1+ i))))
294 (iter-yield i)))))))) 294 (iter-yield i))))))))
295
296(ert-deftest iter-lambda-variable-shadowing ()
297 "`iter-lambda' forms which have local variable shadowing (Bug#26073)."
298 (should (equal (iter-next
299 (funcall (iter-lambda ()
300 (let ((it 1))
301 (iter-yield (funcall
302 (lambda (it) (- it))
303 (1+ it)))))))
304 -2)))