Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
20078:61222b5d173d | 20079:336483164ca6 |
---|---|
585 CheckScriptFailure(['import some from "./Xexport.vim"'], 'E1042:') | 585 CheckScriptFailure(['import some from "./Xexport.vim"'], 'E1042:') |
586 CheckScriptFailure(['vim9script', 'export let g:some'], 'E1044:') | 586 CheckScriptFailure(['vim9script', 'export let g:some'], 'E1044:') |
587 CheckScriptFailure(['vim9script', 'export echo 134'], 'E1043:') | 587 CheckScriptFailure(['vim9script', 'export echo 134'], 'E1043:') |
588 | 588 |
589 assert_fails('vim9script', 'E1038') | 589 assert_fails('vim9script', 'E1038') |
590 assert_fails('export something', 'E1042') | 590 assert_fails('export something', 'E1043') |
591 enddef | 591 enddef |
592 | 592 |
593 def Test_vim9script_reload() | 593 def Test_vim9script_reload() |
594 let lines =<< trim END | 594 let lines =<< trim END |
595 vim9script | 595 vim9script |
1096 'catch', | 1096 'catch', |
1097 'endtry# comment', | 1097 'endtry# comment', |
1098 ], 'E488:') | 1098 ], 'E488:') |
1099 enddef | 1099 enddef |
1100 | 1100 |
1101 def Test_vim9_comment_not_compiled() | |
1102 au TabEnter *.vim let g:entered = 1 | |
1103 au TabEnter *.x let g:entered = 2 | |
1104 | |
1105 edit test.vim | |
1106 doautocmd TabEnter #comment | |
1107 assert_equal(1, g:entered) | |
1108 | |
1109 doautocmd TabEnter f.x | |
1110 assert_equal(2, g:entered) | |
1111 | |
1112 g:entered = 0 | |
1113 doautocmd TabEnter f.x #comment | |
1114 assert_equal(2, g:entered) | |
1115 | |
1116 assert_fails('doautocmd Syntax#comment', 'E216:') | |
1117 | |
1118 au! TabEnter | |
1119 unlet g:entered | |
1120 enddef | |
1121 | |
1101 " Keep this last, it messes up highlighting. | 1122 " Keep this last, it messes up highlighting. |
1102 def Test_substitute_cmd() | 1123 def Test_substitute_cmd() |
1103 new | 1124 new |
1104 setline(1, 'something') | 1125 setline(1, 'something') |
1105 :substitute(some(other( | 1126 :substitute(some(other( |