comparison 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
comparison
equal deleted inserted replaced
23069:fae4ecfc2653 23070:6a70803f4cbe
221 CheckDefFailure(['v:errmsg += 123'], 'E1012:') 221 CheckDefFailure(['v:errmsg += 123'], 'E1012:')
222 222
223 var text =<< trim END 223 var text =<< trim END
224 some text 224 some text
225 END 225 END
226 enddef
227
228 def Test_assign_linebreak()
229 var nr: number
230 nr =
231 123
232 assert_equal(123, nr)
233
234 var n2: number
235 [nr, n2] =
236 [12, 34]
237 assert_equal(12, nr)
238 assert_equal(34, n2)
239
240 CheckDefFailure(["var x = #"], 'E1097:', 2)
226 enddef 241 enddef
227 242
228 def Test_assign_index() 243 def Test_assign_index()
229 # list of list 244 # list of list
230 var l1: list<number> 245 var l1: list<number>