diff options
Diffstat (limited to 'src/nvim/testdir/test_expr.vim')
-rw-r--r-- | src/nvim/testdir/test_expr.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 7e43af9ebd..419d539b42 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -150,3 +150,18 @@ func Test_function_with_funcref() call assert_equal(v:t_string, s:fref('x')) call assert_fails("call function('s:f')", 'E700:') endfunc + +func Test_funcref() + func! One() + return 1 + endfunc + let OneByName = function('One') + let OneByRef = funcref('One') + func! One() + return 2 + endfunc + call assert_equal(2, OneByName()) + call assert_equal(1, OneByRef()) + let OneByRef = funcref('One') + call assert_equal(2, OneByRef()) +endfunc |