From daedbd93124e3334a1024b5d2c60e91b7aeb8fc5 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 6 Aug 2021 20:39:47 +0100 Subject: 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 --- src/nvim/testdir/test_method.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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 -- cgit