aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-27 10:08:13 +0800
committerGitHub <noreply@github.com>2022-10-27 10:08:13 +0800
commit72503a7a4596dd4558e31be428b57f2ce3aaeb4f (patch)
tree90b720770b69ba92de50e079f929c810d96b7c07 /src/nvim/testdir
parentbce6891a69c6de3657173b880d3a800dc94cc651 (diff)
parentacbfbbb649c39694c3a6a92160984db2fcb6f3ec (diff)
downloadrneovim-72503a7a4596dd4558e31be428b57f2ce3aaeb4f.tar.gz
rneovim-72503a7a4596dd4558e31be428b57f2ce3aaeb4f.tar.bz2
rneovim-72503a7a4596dd4558e31be428b57f2ce3aaeb4f.zip
Merge pull request #20824 from zeertzjq/vim-8.2.3408
vim-patch:8.2.{partial:2881,3408}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_user_func.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_user_func.vim b/src/nvim/testdir/test_user_func.vim
index 01bf2e1d0f..7aa21d7816 100644
--- a/src/nvim/testdir/test_user_func.vim
+++ b/src/nvim/testdir/test_user_func.vim
@@ -420,6 +420,16 @@ func Test_del_func()
call assert_fails('delfunction Xabc', 'E130:')
let d = {'a' : 10}
call assert_fails('delfunc d.a', 'E718:')
+ 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
" Test for calling return outside of a function
@@ -451,11 +461,12 @@ func Test_func_dict()
return len(self)
endfunc
- call assert_equal("{'a': 'b', 'somefunc': function('2')}", string(mydict))
+ call assert_equal("{'a': 'b', 'somefunc': function('3')}", string(mydict))
call assert_equal(2, mydict.somefunc())
call assert_match("^\n function \\d\\\+() dict"
\ .. "\n1 return len(self)"
\ .. "\n endfunction$", execute('func mydict.somefunc'))
+ call assert_fails('call mydict.nonexist()', 'E716:')
endfunc
func Test_func_range()