aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-30 11:34:38 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-07-30 12:18:44 +0800
commit8ca3c1515c3fd5f70e870e535649a4c2afc5bbaf (patch)
treeb1a04b07fc123ffb82b9fc98a50f4ffac05ba25d /test
parent2dd0a90f211268517af30607c8eade0fef533edb (diff)
downloadrneovim-8ca3c1515c3fd5f70e870e535649a4c2afc5bbaf.tar.gz
rneovim-8ca3c1515c3fd5f70e870e535649a4c2afc5bbaf.tar.bz2
rneovim-8ca3c1515c3fd5f70e870e535649a4c2afc5bbaf.zip
vim-patch:9.0.0331: cannot use items() on a string
Problem: Cannot use items() on a string. Solution: Make items() work on a string. (closes vim/vim#11016) https://github.com/vim/vim/commit/3e518a8ec74065aedd67d352c93d6ae6be550316 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_listdict.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim
index e976dc4c29..5e4a3fd1f8 100644
--- a/test/old/testdir/test_listdict.vim
+++ b/test/old/testdir/test_listdict.vim
@@ -203,7 +203,16 @@ func Test_list_items()
endfor
call assert_equal([[0, 'a'], [1, 'b'], [2, 'c']], r)
- call assert_fails('call items(3)', 'E1227:')
+ call assert_fails('call items(3)', 'E1225:')
+endfunc
+
+func Test_string_items()
+ let r = []
+ let s = 'ábツ'
+ for [idx, val] in items(s)
+ call extend(r, [[idx, val]])
+ endfor
+ call assert_equal([[0, 'á'], [1, 'b'], [2, 'ツ']], r)
endfunc
" Test removing items in list