mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
vim-patch:partial:9.0.0327: items() does not work on a list
Problem: items() does not work on a list. (Sergey Vlasov)
Solution: Make items() work on a list. (closes vim/vim#11013)
976f859763
Skip CHECK_LIST_MATERIALIZE.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -195,6 +195,17 @@ func Test_list_range_assign()
|
||||
call CheckDefAndScriptFailure(lines, 'E1012:', 2)
|
||||
endfunc
|
||||
|
||||
func Test_list_items()
|
||||
let r = []
|
||||
let l = ['a', 'b', 'c']
|
||||
for [idx, val] in items(l)
|
||||
call extend(r, [[idx, val]])
|
||||
endfor
|
||||
call assert_equal([[0, 'a'], [1, 'b'], [2, 'c']], r)
|
||||
|
||||
call assert_fails('call items(3)', 'E1227:')
|
||||
endfunc
|
||||
|
||||
" Test removing items in list
|
||||
func Test_list_func_remove()
|
||||
let lines =<< trim END
|
||||
|
Reference in New Issue
Block a user