mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.0754: Vim9: No test for forward declaration
Problem: Vim9: No test for forward declaration. Solution: Add a test.
This commit is contained in:
parent
32e351179e
commit
a5d0077efb
@ -1732,6 +1732,7 @@ def Test_let_func_call()
|
|||||||
END
|
END
|
||||||
writefile(lines, 'Xfinished')
|
writefile(lines, 'Xfinished')
|
||||||
source Xfinished
|
source Xfinished
|
||||||
|
" GetValue() is not called during discovery phase
|
||||||
assert_equal(1, g:count)
|
assert_equal(1, g:count)
|
||||||
|
|
||||||
unlet g:count
|
unlet g:count
|
||||||
@ -1752,6 +1753,28 @@ def Test_let_missing_type()
|
|||||||
delete('Xfinished')
|
delete('Xfinished')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_forward_declaration()
|
||||||
|
let lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
g:initVal = GetValue()
|
||||||
|
def GetValue(): string
|
||||||
|
return theVal
|
||||||
|
enddef
|
||||||
|
let theVal = 'something'
|
||||||
|
theVal = 'else'
|
||||||
|
g:laterVal = GetValue()
|
||||||
|
END
|
||||||
|
writefile(lines, 'Xforward')
|
||||||
|
source Xforward
|
||||||
|
assert_equal('something', g:initVal)
|
||||||
|
assert_equal('else', g:laterVal)
|
||||||
|
|
||||||
|
unlet g:initVal
|
||||||
|
unlet g:laterVal
|
||||||
|
delete('Xforward')
|
||||||
|
enddef
|
||||||
|
|
||||||
|
|
||||||
" Keep this last, it messes up highlighting.
|
" Keep this last, it messes up highlighting.
|
||||||
def Test_substitute_cmd()
|
def Test_substitute_cmd()
|
||||||
new
|
new
|
||||||
|
@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
754,
|
||||||
/**/
|
/**/
|
||||||
753,
|
753,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user