0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.2144: Vim9: some corner cases not tested

Problem:    Vim9: some corner cases not tested.
Solution:   Add a few tests.
This commit is contained in:
Bram Moolenaar
2020-12-14 18:31:27 +01:00
parent ec792290eb
commit 025cb1ca86
3 changed files with 27 additions and 12 deletions

View File

@@ -23,6 +23,11 @@ def Test_range_only()
list
assert_equal('three$', Screenline(&lines))
bwipe!
# won't generate anything
if false
:123
endif
enddef
let g:alist = [7]
@@ -1890,6 +1895,9 @@ def Test_for_loop()
enddef
def Test_for_loop_fails()
CheckDefFailure(['for '], 'E1097:')
CheckDefFailure(['for x'], 'E1097:')
CheckDefFailure(['for x in'], 'E1097:')
CheckDefFailure(['for # in range(5)'], 'E690:')
CheckDefFailure(['for i In range(5)'], 'E690:')
CheckDefFailure(['var x = 5', 'for x in range(5)'], 'E1017:')
@@ -3054,18 +3062,6 @@ def Test_no_unknown_error_after_error()
delete('Xdef')
enddef
def Test_put_with_linebreak()
new
var lines =<< trim END
vim9script
pu =split('abc', '\zs')
->join()
END
CheckScriptSuccess(lines)
getline(2)->assert_equal('a b c')
bwipe!
enddef
def InvokeNormal()
exe "norm! :m+1\r"
enddef