forked from aniani/vim
patch 8.2.3031: no error if a function name starts with an underscore
Problem: No error if a function name starts with an underscore. (Naohiro
Ono)
Solution: In Vim9 script disallow a function name starting with an
underscore, as is mentioned in the help. (closes #8414)
This commit is contained in:
@@ -90,6 +90,24 @@ def Test_compile_error_in_called_function()
|
||||
CheckScriptFailureList(lines, ['E1012:', 'E1191:'])
|
||||
enddef
|
||||
|
||||
def Test_wrong_function_name()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
func _Foo()
|
||||
echo 'foo'
|
||||
endfunc
|
||||
END
|
||||
CheckScriptFailure(lines, 'E128:')
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def _Foo()
|
||||
echo 'foo'
|
||||
enddef
|
||||
END
|
||||
CheckScriptFailure(lines, 'E128:')
|
||||
enddef
|
||||
|
||||
def Test_autoload_name_mismatch()
|
||||
var dir = 'Xdir/autoload'
|
||||
mkdir(dir, 'p')
|
||||
|
||||
Reference in New Issue
Block a user