diff src/testdir/test_vim9_script.vim @ 23066:b3124656f050 v8.2.2079

patch 8.2.2079: Vim9: cannot put a linebreak before or after "in" of ":for" Commit: https://github.com/vim/vim/commit/38bd8de551225bfca133805f21cee2592f0c759d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 2 13:23:36 2020 +0100 patch 8.2.2079: Vim9: cannot put a linebreak before or after "in" of ":for" Problem: Vim9: cannot put a linebreak before or after "in" of ":for". Solution: Skip over linebreak.
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Dec 2020 13:30:04 +0100
parents 57b6427c18e4
children 2f034cb0a046
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -1849,6 +1849,28 @@ def Test_for_loop()
     concat ..= str
   endfor
   assert_equal('onetwo', concat)
+
+  var total = 0
+  for nr in
+      [1, 2, 3]
+    total += nr
+  endfor
+  assert_equal(6, total)
+
+  total = 0
+  for nr
+    in [1, 2, 3]
+    total += nr
+  endfor
+  assert_equal(6, total)
+
+  total = 0
+  for nr
+    in
+    [1, 2, 3]
+    total += nr
+  endfor
+  assert_equal(6, total)
 enddef
 
 def Test_for_loop_fails()