diff options
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r-- | src/testdir/test_ins_complete.vim | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 083fa68f77..d39acf4270 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -923,7 +923,7 @@ func Test_completefunc_callback() call add(g:MycompleteFunc3_args, [a:findstart, a:base]) return a:findstart ? 0 : [] endfunc - set completefunc={a,\ b,\ ->\ MycompleteFunc3(a,\ b,)} + set completefunc={a,\ b\ ->\ MycompleteFunc3(a,\ b)} new | only call setline(1, 'five') let g:MycompleteFunc3_args = [] @@ -986,26 +986,29 @@ func Test_completefunc_callback() bw! # Test for using a lambda - def MycompleteFunc2(findstart: number, base: string): any - add(g:MycompleteFunc2_args, [findstart, base]) + def LambdaComplete1(findstart: number, base: string): any + add(g:LambdaComplete1_args, [findstart, base]) return findstart ? 0 : [] enddef - &completefunc = '(a, b) => MycompleteFunc2(a, b)' + &completefunc = '(a, b) => LambdaComplete1(a, b)' new | only setline(1, 'two') - g:MycompleteFunc2_args = [] + g:LambdaComplete1_args = [] feedkeys("A\<C-X>\<C-U>\<Esc>", 'x') - assert_equal([[1, ''], [0, 'two']], g:MycompleteFunc2_args) + assert_equal([[1, ''], [0, 'two']], g:LambdaComplete1_args) bw! # Test for using a variable with a lambda expression - var Fn: func = (a, b) => MycompleteFunc2(a, b) + var Fn: func = (findstart, base) => { + add(g:LambdaComplete2_args, [findstart, base]) + return findstart ? 0 : [] + } &completefunc = string(Fn) new | only setline(1, 'three') - g:MycompleteFunc2_args = [] + g:LambdaComplete2_args = [] feedkeys("A\<C-X>\<C-U>\<Esc>", 'x') - assert_equal([[1, ''], [0, 'three']], g:MycompleteFunc2_args) + assert_equal([[1, ''], [0, 'three']], g:LambdaComplete2_args) bw! END call CheckScriptSuccess(lines) @@ -1080,7 +1083,7 @@ func Test_omnifunc_callback() call add(g:MyomniFunc3_args, [a:findstart, a:base]) return a:findstart ? 0 : [] endfunc - set omnifunc={a,\ b,\ ->\ MyomniFunc3(a,\ b,)} + set omnifunc={a,\ b\ ->\ MyomniFunc3(a,\ b)} new | only call setline(1, 'five') let g:MyomniFunc3_args = [] @@ -1237,7 +1240,7 @@ func Test_thesaurusfunc_callback() call add(g:MytsrFunc3_args, [a:findstart, a:base]) return a:findstart ? 0 : [] endfunc - set thesaurusfunc={a,\ b,\ ->\ MytsrFunc3(a,\ b,)} + set thesaurusfunc={a,\ b\ ->\ MytsrFunc3(a,\ b)} new | only call setline(1, 'five') let g:MytsrFunc3_args = [] |