Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 20079:336483164ca6 v8.2.0595
patch 8.2.0595: Vim9: not all commands using ends_excmd() tested
Commit: https://github.com/vim/vim/commit/a26b9700d73ebccd6c5459d0d66032a4249f6b72
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 18 19:53:28 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 Apr 2020 20:00:04 +0200 |
parents | 6e6a75800884 |
children | 7fc5d62fe2a5 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -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