diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-05-24 15:15:47 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-05-24 15:15:47 +0200 |
commit | 611728f80604dd56960e8c197e5749d203c8feb1 (patch) | |
tree | 1c056b902cf1516372f1024f0fa1659cbc56e32a /src/testdir/test_user_func.vim | |
parent | ad5c178a191cf2cf37a27c2a789d7afda3879831 (diff) | |
download | vim-git-611728f80604dd56960e8c197e5749d203c8feb1.tar.gz |
patch 8.2.2881: various pieces of code not covered by testsv8.2.2881
Problem: Various pieces of code not covered by tests.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes #8245)
Diffstat (limited to 'src/testdir/test_user_func.vim')
-rw-r--r-- | src/testdir/test_user_func.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testdir/test_user_func.vim b/src/testdir/test_user_func.vim index a58aa64b9..4b8ec99a2 100644 --- a/src/testdir/test_user_func.vim +++ b/src/testdir/test_user_func.vim @@ -405,6 +405,7 @@ func Test_func_def_error() let l = join(lines, "\n") . "\n" exe l call assert_fails('exe l', 'E717:') + call assert_fails('call feedkeys(":func d.F1()\<CR>", "xt")', 'E717:') " Define an autoload function with an incorrect file name call writefile(['func foo#Bar()', 'return 1', 'endfunc'], 'Xscript') @@ -420,6 +421,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 +457,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() |