Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 20113:2c23053c654a v8.2.0612
patch 8.2.0612: Vim9: no check for space before #comment
Commit: https://github.com/vim/vim/commit/2c5ed4e3300378ce76c8d9c3818d6f73e5119f68
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 20 19:42:10 2020 +0200
patch 8.2.0612: Vim9: no check for space before #comment
Problem: Vim9: no check for space before #comment.
Solution: Add space checks.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 Apr 2020 19:45:03 +0200 |
parents | f40231487a49 |
children | 513c62184ed8 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1153,22 +1153,76 @@ def Test_vim9_comment() CheckDefFailure([ 'try# comment', - 'echo "yes"', + ' echo "yes"', 'catch', 'endtry', ], 'E488:') + CheckScriptFailure([ + 'vim9script', + 'try# comment', + 'echo "yes"', + ], 'E488:') CheckDefFailure([ 'try', - 'echo "yes"', + ' echo "yes"', 'catch# comment', 'endtry', ], 'E488:') + CheckScriptFailure([ + 'vim9script', + 'try', + ' echo "yes"', + 'catch# comment', + 'endtry', + ], 'E654:') + CheckDefFailure([ + 'try', + ' echo "yes"', + 'catch /pat/# comment', + 'endtry', + ], 'E488:') + CheckScriptFailure([ + 'vim9script', + 'try', + ' throw "pat"', + 'catch /pat/# comment', + 'endtry', + ], 'E605:') CheckDefFailure([ 'try', 'echo "yes"', 'catch', 'endtry# comment', ], 'E488:') + CheckScriptFailure([ + 'vim9script', + 'try', + ' echo "yes"', + 'catch', + 'endtry# comment', + ], 'E600:') + + CheckScriptSuccess([ + 'vim9script', + 'hi # comment', + ]) + CheckScriptFailure([ + 'vim9script', + 'hi# comment', + ], 'E416:') +enddef + +def Test_vim9_comment_gui() + CheckCanRunGui + + CheckScriptFailure([ + 'vim9script', + 'gui#comment' + ], 'E499:') + CheckScriptFailure([ + 'vim9script', + 'gui -f#comment' + ], 'E499:') enddef def Test_vim9_comment_not_compiled()