]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1821: no test for wrong number of method arguments v8.1.1821
authorBram Moolenaar <Bram@vim.org>
Tue, 6 Aug 2019 18:34:10 +0000 (20:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 6 Aug 2019 18:34:10 +0000 (20:34 +0200)
Problem:    No test for wrong number of method arguments.
Solution:   Add a test.

src/testdir/test_method.vim
src/version.c

index 6d90a8f82188890efadaa2a45e881035d9f2413b..02c69f23eaf7d3b9c9a22f1142b4a3e668ab9a27 100644 (file)
@@ -97,8 +97,18 @@ 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
index b0d9481a6251e211cd2d7ec0ddeb02120fb85eec..aad783376794fa4893af91ff0a9b7dd1b14bf36f 100644 (file)
@@ -773,6 +773,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1821,
 /**/
     1820,
 /**/