comparison src/testdir/test_vim9_assign.vim @ 22545:47596deedfb5 v8.2.1821

patch 8.2.1821: Vim9: concatenating to a NULL list doesn't work Commit: https://github.com/vim/vim/commit/1a73923705744ab8297dd856d194e20297563456 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 10 15:37:58 2020 +0200 patch 8.2.1821: Vim9: concatenating to a NULL list doesn't work Problem: Vim9: concatenating to a NULL list doesn't work. Solution: Handle a NULL list like an empty list. (closes https://github.com/vim/vim/issues/7064)
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Oct 2020 15:45:03 +0200
parents 4c21f7f6f9e3
children a3df1fb28d44
comparison
equal deleted inserted replaced
22544:beaa663bf63c 22545:47596deedfb5
232 assert_equal([123], l) 232 assert_equal([123], l)
233 233
234 var d: dict<number> 234 var d: dict<number>
235 d['one'] = 1 235 d['one'] = 1
236 assert_equal(#{one: 1}, d) 236 assert_equal(#{one: 1}, d)
237 END
238 CheckScriptSuccess(lines)
239
240 # appending to NULL list from a function
241 lines =<< trim END
242 vim9script
243 var list: list<string>
244 def Func()
245 list += ['a', 'b']
246 enddef
247 Func()
248 assert_equal(['a', 'b'], list)
237 END 249 END
238 CheckScriptSuccess(lines) 250 CheckScriptSuccess(lines)
239 enddef 251 enddef
240 252
241 def Test_single_letter_vars() 253 def Test_single_letter_vars()