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.
f97d46f816
This commit is contained in:
Sean Dewar 2021-08-06 20:39:47 +01:00
parent d41b87e070
commit daedbd9312
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581

View File

@ -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