diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-30 11:08:16 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-07-30 12:18:38 +0800 |
commit | 96b358e9f138e60a24c3f3c9b45e9b82ffb92c1c (patch) | |
tree | ea6a0d4ca9039e5fb59c8de4e45d92b3c8194259 /test | |
parent | cd4638366759bc984d4cb7207a56e5bc112f4179 (diff) | |
download | rneovim-96b358e9f138e60a24c3f3c9b45e9b82ffb92c1c.tar.gz rneovim-96b358e9f138e60a24c3f3c9b45e9b82ffb92c1c.tar.bz2 rneovim-96b358e9f138e60a24c3f3c9b45e9b82ffb92c1c.zip |
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)
https://github.com/vim/vim/commit/976f859763b215050a03248dbc2bb62fa5d0d059
Skip CHECK_LIST_MATERIALIZE.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_listdict.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim index 35d63c87d0..e976dc4c29 100644 --- a/test/old/testdir/test_listdict.vim +++ b/test/old/testdir/test_listdict.vim @@ -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 |