0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.0994: Vim9: missing function causes compilation error

Problem:    Vim9: missing function causes compilation error.
Solution:   Call test function indirectly.
This commit is contained in:
Bram Moolenaar
2020-06-17 20:03:36 +02:00
parent f7d267ef20
commit 9bb3eb3e02
2 changed files with 14 additions and 6 deletions

View File

@@ -781,20 +781,26 @@ enddef
func Test_import_fails_without_script()
CheckRunVimInTerminal
" call indirectly to avoid compilation error for missing functions
call Run_Test_import_fails_without_script()
endfunc
def Run_Test_import_fails_without_script()
let export =<< trim END
vim9script
export def Foo(): number
return 0
enddef
END
call writefile(export, 'Xexport.vim')
writefile(export, 'Xexport.vim')
let buf = RunVimInTerminal('-c "import Foo from ''./Xexport.vim''"', #{rows: 6, wait_for_ruler: 0})
call WaitForAssert({-> assert_match('^E1094:', term_getline(buf, 5))})
let buf = RunVimInTerminal('-c "import Foo from ''./Xexport.vim''"', #{
rows: 6, wait_for_ruler: 0})
WaitForAssert({-> assert_match('^E1094:', term_getline(buf, 5))})
call delete('Xexport.vim')
call StopVimInTerminal(buf)
endfunc
delete('Xexport.vim')
StopVimInTerminal(buf)
enddef
def Test_vim9script_reload_import()
let lines =<< trim END

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
994,
/**/
993,
/**/