aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-01-27 08:47:01 +0100
committerGitHub <noreply@github.com>2022-01-27 08:47:01 +0100
commit618f7079e51a62ef67b0f5e0cb75ff9ccdb9ffcd (patch)
tree6fe01438cdd33a20e8c239931120cbefcdc275df /src/nvim/testdir
parent95b8a8f6aed2057dbbb745c703612d1ace5eb2b2 (diff)
parent1ae73e2d1c328a6181f4ebaebfc273e1d1c8d59d (diff)
downloadrneovim-618f7079e51a62ef67b0f5e0cb75ff9ccdb9ffcd.tar.gz
rneovim-618f7079e51a62ef67b0f5e0cb75ff9ccdb9ffcd.tar.bz2
rneovim-618f7079e51a62ef67b0f5e0cb75ff9ccdb9ffcd.zip
Merge pull request #17135 from seandewar/vim-8.2.0175
vim-patch:8.2.0175: crash when removing list element in map()
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_filter_map.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_filter_map.vim b/src/nvim/testdir/test_filter_map.vim
index a52a66ac2f..1cd3a2287b 100644
--- a/src/nvim/testdir/test_filter_map.vim
+++ b/src/nvim/testdir/test_filter_map.vim
@@ -88,4 +88,14 @@ func Test_map_filter_fails()
call assert_fails("let l = filter('abc', '\"> \" . v:val')", 'E896:')
endfunc
+func Test_map_and_modify()
+ let l = ["abc"]
+ " cannot change the list halfway a map()
+ call assert_fails('call map(l, "remove(l, 0)[0]")', 'E741:')
+
+ let d = #{a: 1, b: 2, c: 3}
+ call assert_fails('call map(d, "remove(d, v:key)[0]")', 'E741:')
+ call assert_fails('echo map(d, {k,v -> remove(d, k)})', 'E741:')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab