diff src/testdir/test_vim9_assign.vim @ 23070:6a70803f4cbe v8.2.2081

patch 8.2.2081: Vim9: cannot handle a linebreak after "=" in assignment Commit: https://github.com/vim/vim/commit/7f76494aac512b1d603d9be4132184241f43872c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 2 15:11:18 2020 +0100 patch 8.2.2081: Vim9: cannot handle a linebreak after "=" in assignment Problem: Vim9: cannot handle a linebreak after "=" in assignment. Solution: Skip over linebreak. (closes https://github.com/vim/vim/issues/7407)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Dec 2020 15:15:05 +0100
parents 9775df18916b
children 4b398a229b0b
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -225,6 +225,21 @@ def Test_assignment()
   END
 enddef
 
+def Test_assign_linebreak()
+  var nr: number
+  nr =
+      123
+  assert_equal(123, nr)
+
+  var n2: number
+  [nr, n2] =
+     [12, 34]
+  assert_equal(12, nr)
+  assert_equal(34, n2)
+
+  CheckDefFailure(["var x = #"], 'E1097:', 2)
+enddef
+
 def Test_assign_index()
   # list of list
   var l1: list<number>