diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-06 20:39:47 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-12 22:35:21 +0100 |
commit | daedbd93124e3334a1024b5d2c60e91b7aeb8fc5 (patch) | |
tree | 360398d9318fcb2870368ece60b79a4eb7857ef4 /src | |
parent | d41b87e070037786bf2cc4486b1839169805ee21 (diff) | |
download | rneovim-daedbd93124e3334a1024b5d2c60e91b7aeb8fc5.tar.gz rneovim-daedbd93124e3334a1024b5d2c60e91b7aeb8fc5.tar.bz2 rneovim-daedbd93124e3334a1024b5d2c60e91b7aeb8fc5.zip |
vim-patch:8.1.1821: no test for wrong number of method arguments
Problem: No test for wrong number of method arguments.
Solution: Add a test.
https://github.com/vim/vim/commit/f97d46f816e84edb6899a903a1c334a50a6d31bb
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_method.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_method.vim b/src/nvim/testdir/test_method.vim index a1fbe7af28..142b259e78 100644 --- a/src/nvim/testdir/test_method.vim +++ b/src/nvim/testdir/test_method.vim @@ -102,9 +102,19 @@ func Test_method_funcref() let FuncRef = function('Concat') eval 'foo'->FuncRef('bar', 'tail')->assert_equal('foobartail') + " not enough arguments + call assert_fails("eval 'foo'->FuncRef('bar')", 'E119:') + " too many arguments + call assert_fails("eval 'foo'->FuncRef('bar', 'tail', 'four')", 'E118:') + let Partial = function('Concat', ['two']) eval 'one'->Partial('three')->assert_equal('onetwothree') + " not enough arguments + call assert_fails("eval 'one'->Partial()", 'E119:') + " too many arguments + call assert_fails("eval 'one'->Partial('three', 'four')", 'E118:') + delfunc Concat endfunc |