diff options
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_func.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 957b632e1..5e3ca1c2c 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -621,6 +621,30 @@ def Test_local_function_shadows_global() END CheckScriptFailure(lines, 'E705:') delfunc g:Func + + # global function is found without g: prefix + lines =<< trim END + vim9script + def g:Func(): string + return 'global' + enddef + def AnotherFunc(): string + return Func() + enddef + assert_equal('global', AnotherFunc()) + delfunc g:Func + END + CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + def g:Func(): string + return 'global' + enddef + assert_equal('global', Func()) + delfunc g:Func + END + CheckScriptSuccess(lines) enddef func TakesOneArg(arg) |