diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-27 09:36:54 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-27 09:40:45 +0800 |
commit | 9eaae3d56b8d44907da3286084d3ee7b50fe7a07 (patch) | |
tree | 73b95ec48f3ebf1be3ae14769b58935a07a67539 | |
parent | bce6891a69c6de3657173b880d3a800dc94cc651 (diff) | |
download | rneovim-9eaae3d56b8d44907da3286084d3ee7b50fe7a07.tar.gz rneovim-9eaae3d56b8d44907da3286084d3ee7b50fe7a07.tar.bz2 rneovim-9eaae3d56b8d44907da3286084d3ee7b50fe7a07.zip |
vim-patch:partial:8.2.2881: various pieces of code not covered by tests
Problem: Various pieces of code not covered by tests.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8245)
https://github.com/vim/vim/commit/611728f80604dd56960e8c197e5749d203c8feb1
Only port the last two hunks of test_user_func.vim.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
-rw-r--r-- | src/nvim/testdir/test_user_func.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_user_func.vim b/src/nvim/testdir/test_user_func.vim index 01bf2e1d0f..98c2fdd531 100644 --- a/src/nvim/testdir/test_user_func.vim +++ b/src/nvim/testdir/test_user_func.vim @@ -420,6 +420,11 @@ 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 + delfunc d.fn + call assert_equal({'a' : 10}, d) endfunc " Test for calling return outside of a function @@ -451,11 +456,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() |