]> git.eshelyaron.com Git - emacs.git/commitdiff
; Add test for iter-lambda variable shadowing (Bug#26073)
authorNoam Postavsky <npostavs@gmail.com>
Thu, 15 Feb 2018 02:31:06 +0000 (21:31 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Thu, 15 Feb 2018 02:31:06 +0000 (21:31 -0500)
* test/lisp/emacs-lisp/generator-tests.el
(iter-lambda-variable-shadowing): New test.

test/lisp/emacs-lisp/generator-tests.el

index 9bf8413e1598562ba0e66d72b2f3c4b2469bb244..bca3efa550b1a2843c2bb5ca5aa7f82130c2d26f 100644 (file)
@@ -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)))