1
0
forked from aniani/vim

patch 8.2.0565: Vim9: tests contain superfluous line continuation

Problem:    Vim9: tests contain superfluous line continuation.
Solution:   Remove line continuation no longer needed.  Skip empty lines.
This commit is contained in:
Bram Moolenaar
2020-04-12 22:53:54 +02:00
parent 23e032523e
commit 675f716efb
4 changed files with 502 additions and 499 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -599,7 +599,8 @@ def Test_vim9script_reload()
return valtwo return valtwo
enddef enddef
END END
writefile(lines + morelines, 'Xreload.vim') writefile(lines + morelines,
'Xreload.vim')
source Xreload.vim source Xreload.vim
source Xreload.vim source Xreload.vim
source Xreload.vim source Xreload.vim
@@ -653,15 +654,15 @@ def Test_import_absolute()
assert_equal(9876, g:imported_abs) assert_equal(9876, g:imported_abs)
assert_equal(8888, g:imported_after) assert_equal(8888, g:imported_after)
assert_match('<SNR>\d\+_UseExported.*' assert_match('<SNR>\d\+_UseExported.*' ..
\ .. 'g:imported_abs = exported.*' 'g:imported_abs = exported.*' ..
\ .. '0 LOADSCRIPT exported from .*Xexport_abs.vim.*' '0 LOADSCRIPT exported from .*Xexport_abs.vim.*' ..
\ .. '1 STOREG g:imported_abs.*' '1 STOREG g:imported_abs.*' ..
\ .. 'exported = 8888.*' 'exported = 8888.*' ..
\ .. '3 STORESCRIPT exported in .*Xexport_abs.vim.*' '3 STORESCRIPT exported in .*Xexport_abs.vim.*' ..
\ .. 'g:imported_after = exported.*' 'g:imported_after = exported.*' ..
\ .. '4 LOADSCRIPT exported from .*Xexport_abs.vim.*' '4 LOADSCRIPT exported from .*Xexport_abs.vim.*' ..
\ .. '5 STOREG g:imported_after.*', '5 STOREG g:imported_after.*',
g:import_disassembled) g:import_disassembled)
unlet g:imported_abs unlet g:imported_abs
unlet g:import_disassembled unlet g:import_disassembled
@@ -913,14 +914,14 @@ def Test_for_loop()
enddef enddef
def Test_for_loop_fails() def Test_for_loop_fails()
call CheckDefFailure(['for # in range(5)'], 'E690:') CheckDefFailure(['for # in range(5)'], 'E690:')
call CheckDefFailure(['for i In range(5)'], 'E690:') CheckDefFailure(['for i In range(5)'], 'E690:')
call CheckDefFailure(['let x = 5', 'for x in range(5)'], 'E1023:') CheckDefFailure(['let x = 5', 'for x in range(5)'], 'E1023:')
call CheckScriptFailure(['def Func(arg)', 'for arg in range(5)', 'enddef'], 'E1006:') CheckScriptFailure(['def Func(arg)', 'for arg in range(5)', 'enddef'], 'E1006:')
call CheckDefFailure(['for i in "text"'], 'E1024:') CheckDefFailure(['for i in "text"'], 'E1024:')
call CheckDefFailure(['for i in xxx'], 'E1001:') CheckDefFailure(['for i in xxx'], 'E1001:')
call CheckDefFailure(['endfor'], 'E588:') CheckDefFailure(['endfor'], 'E588:')
call CheckDefFailure(['for i in range(3)', 'echo 3'], 'E170:') CheckDefFailure(['for i in range(3)', 'echo 3'], 'E170:')
enddef enddef
def Test_while_loop() def Test_while_loop()
@@ -940,13 +941,13 @@ def Test_while_loop()
enddef enddef
def Test_while_loop_fails() def Test_while_loop_fails()
call CheckDefFailure(['while xxx'], 'E1001:') CheckDefFailure(['while xxx'], 'E1001:')
call CheckDefFailure(['endwhile'], 'E588:') CheckDefFailure(['endwhile'], 'E588:')
call CheckDefFailure(['continue'], 'E586:') CheckDefFailure(['continue'], 'E586:')
call CheckDefFailure(['if true', 'continue'], 'E586:') CheckDefFailure(['if true', 'continue'], 'E586:')
call CheckDefFailure(['break'], 'E587:') CheckDefFailure(['break'], 'E587:')
call CheckDefFailure(['if true', 'break'], 'E587:') CheckDefFailure(['if true', 'break'], 'E587:')
call CheckDefFailure(['while 1', 'echo 3'], 'E170:') CheckDefFailure(['while 1', 'echo 3'], 'E170:')
enddef enddef
def Test_interrupt_loop() def Test_interrupt_loop()

View File

@@ -738,6 +738,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 */
/**/
565,
/**/ /**/
564, 564,
/**/ /**/

View File

@@ -2065,7 +2065,7 @@ next_line_from_context(cctx_T *cctx)
line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum]; line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum];
SOURCING_LNUM = cctx->ctx_ufunc->uf_script_ctx.sc_lnum SOURCING_LNUM = cctx->ctx_ufunc->uf_script_ctx.sc_lnum
+ cctx->ctx_lnum + 1; + cctx->ctx_lnum + 1;
} while (line == NULL); } while (line == NULL || *skipwhite(line) == NUL);
return line; return line;
} }