0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.0595: Vim9: not all commands using ends_excmd() tested

Problem:    Vim9: not all commands using ends_excmd() tested.
Solution:   Find # comment after regular commands. Add more tests.  Report
            error for where it was caused.
This commit is contained in:
Bram Moolenaar
2020-04-18 19:53:28 +02:00
parent b6fb0516ec
commit a26b9700d7
10 changed files with 122 additions and 15 deletions

View File

@@ -587,7 +587,7 @@ def Test_vim9script_fails()
CheckScriptFailure(['vim9script', 'export echo 134'], 'E1043:')
assert_fails('vim9script', 'E1038')
assert_fails('export something', 'E1042')
assert_fails('export something', 'E1043')
enddef
def Test_vim9script_reload()
@@ -1098,6 +1098,27 @@ def Test_vim9_comment()
], 'E488:')
enddef
def Test_vim9_comment_not_compiled()
au TabEnter *.vim let g:entered = 1
au TabEnter *.x let g:entered = 2
edit test.vim
doautocmd TabEnter #comment
assert_equal(1, g:entered)
doautocmd TabEnter f.x
assert_equal(2, g:entered)
g:entered = 0
doautocmd TabEnter f.x #comment
assert_equal(2, g:entered)
assert_fails('doautocmd Syntax#comment', 'E216:')
au! TabEnter
unlet g:entered
enddef
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new