mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.4601: Vim9: not enough test coverage for executing :def function
Problem: Vim9: not enough test coverage for executing :def function. Solution: Add a few more tests.
This commit is contained in:
@@ -1660,6 +1660,8 @@ def Test_substitute_expr()
|
|||||||
v9.CheckDefFailure(['s/from/\="x")/'], 'E488:')
|
v9.CheckDefFailure(['s/from/\="x")/'], 'E488:')
|
||||||
v9.CheckDefFailure(['s/from/\="x"/9'], 'E488:')
|
v9.CheckDefFailure(['s/from/\="x"/9'], 'E488:')
|
||||||
|
|
||||||
|
v9.CheckDefExecFailure(['s/this/\="that"/'], 'E486:')
|
||||||
|
|
||||||
# When calling a function the right instruction list needs to be restored.
|
# When calling a function the right instruction list needs to be restored.
|
||||||
g:cond = true
|
g:cond = true
|
||||||
var lines =<< trim END
|
var lines =<< trim END
|
||||||
|
@@ -4085,6 +4085,19 @@ if has('lua')
|
|||||||
EOF
|
EOF
|
||||||
assert_equal('val', g:d.key)
|
assert_equal('val', g:d.key)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_lua_heredoc_fails()
|
||||||
|
var lines = [
|
||||||
|
'vim9script',
|
||||||
|
'def ExeLua()',
|
||||||
|
'lua << trim EOLUA',
|
||||||
|
"x = vim.eval('g:nodict')",
|
||||||
|
'EOLUA',
|
||||||
|
'enddef',
|
||||||
|
'ExeLua()',
|
||||||
|
]
|
||||||
|
v9.CheckScriptFailure(lines, 'E121: Undefined variable: g:nodict')
|
||||||
|
enddef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2003,6 +2003,12 @@ def Test_for_loop()
|
|||||||
endfor
|
endfor
|
||||||
assert_equal(6, total)
|
assert_equal(6, total)
|
||||||
|
|
||||||
|
total = 0
|
||||||
|
for b in 0z010203
|
||||||
|
total += b
|
||||||
|
endfor
|
||||||
|
assert_equal(6, total)
|
||||||
|
|
||||||
var chars = ''
|
var chars = ''
|
||||||
for s: string in 'foobar'
|
for s: string in 'foobar'
|
||||||
chars ..= s
|
chars ..= s
|
||||||
|
@@ -750,6 +750,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 */
|
||||||
|
/**/
|
||||||
|
4601,
|
||||||
/**/
|
/**/
|
||||||
4600,
|
4600,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user