Lines Matching refs:function
2 " Also test an <expr> mapping calling a function.
3 " Also test that a builtin function cannot be replaced.
53 let g:FuncRef = function("FuncWithRef")
89 " Try to overwrite a function in the global (g:) scope
91 call assert_fails("call extend(g:, {'max': function('min')})", 'E704:')
94 " Try to overwrite an user defined function with a function reference
95 call assert_fails("let Expr1 = function('min')", 'E705:')
100 call assert_equal(0, (0 && (function('tr'))(1, 2, 3)))
101 call assert_equal(1, (1 && (function('tr'))(1, 2, 3)))
159 \ .. " function Args2(a = 1, b = 2, c = 3)\n"
189 call assert_fails("function Xabc", 'E123:')
192 " Test for <sfile>, <slnum> in a function
246 function Foo()
261 " Try deleting the current function
311 let m = matchstr(res, 'function F1()[^[:print:]]*[[:print:]]*')
314 let m = matchstr(res, 'function F2()[^[:print:]]*[[:print:]]*')
317 let m = matchstr(res, 'function F3()[^[:print:]]*[[:print:]]*')
320 let m = matchstr(res, 'function F4()[^[:print:]]*[[:print:]]*')
323 let m = matchstr(res, 'function F5()[^[:print:]]*[[:print:]]*')
326 let m = matchstr(res, 'function F6()[^[:print:]]*[[:print:]]*')
332 " Test for defining a function reference in the global scope
357 " Test for script-local function
376 " Try to call a script local function in global scope
398 " Try to redefine a function that is in use
408 " Try to define a function in a dict twice
420 " Define an autoload function with an incorrect file name
426 call assert_fails('function /\%(/', 'E53:')
429 " Test for deleting a function
438 " cannot delete the dict function by number
439 let nr = substitute(execute('echo d'), '.*function(''\(\d\+\)'').*', '\1', '')
446 " Test for calling return outside of a function
453 " Test for errors in calling a function
471 function mydict.somefunc() dict
475 call assert_equal("{'a': 'b', 'somefunc': function('3')}", string(mydict))
477 call assert_match("^\n function \\d\\\+() dict"
493 call assert_equal("\n function FuncRange() range"
497 \ execute('function FuncRange'))