aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-27 09:44:13 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-10-27 09:45:56 +0800
commitacbfbbb649c39694c3a6a92160984db2fcb6f3ec (patch)
tree90b720770b69ba92de50e079f929c810d96b7c07 /src/nvim/testdir
parent9eaae3d56b8d44907da3286084d3ee7b50fe7a07 (diff)
downloadrneovim-acbfbbb649c39694c3a6a92160984db2fcb6f3ec.tar.gz
rneovim-acbfbbb649c39694c3a6a92160984db2fcb6f3ec.tar.bz2
rneovim-acbfbbb649c39694c3a6a92160984db2fcb6f3ec.zip
vim-patch:8.2.3408: can delete a numbered function
Problem: Can delete a numbered function. (Naohiro Ono) Solution: Disallow deleting a numbered function. (closes vim/vim#8760) https://github.com/vim/vim/commit/ddfc05100a29263a682dd96bb924dfde4354a654 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_user_func.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_user_func.vim b/src/nvim/testdir/test_user_func.vim
index 98c2fdd531..7aa21d7816 100644
--- a/src/nvim/testdir/test_user_func.vim
+++ b/src/nvim/testdir/test_user_func.vim
@@ -423,6 +423,11 @@ func Test_del_func()
func d.fn()
return 1
endfunc
+
+ " cannot delete the dict function by number
+ let nr = substitute(execute('echo d'), '.*function(''\(\d\+\)'').*', '\1', '')
+ call assert_fails('delfunction g:' .. nr, 'E475: Invalid argument: g:')
+
delfunc d.fn
call assert_equal({'a' : 10}, d)
endfunc