Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 20111:f40231487a49 v8.2.0611
patch 8.2.0611: Vim9: no check for space before #comment
Commit: https://github.com/vim/vim/commit/faac410409a8d693a0326ad9db42dca85419a391
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 20 17:46:14 2020 +0200
patch 8.2.0611: 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 18:00:03 +0200 |
parents | 058b41f85bcb |
children | 2c23053c654a |
comparison
equal
deleted
inserted
replaced
20110:e24fd2902727 | 20111:f40231487a49 |
---|---|
1206 | 1206 |
1207 CheckScriptFailure([ | 1207 CheckScriptFailure([ |
1208 'let g:var = 123', | 1208 'let g:var = 123', |
1209 'unlet g:var # something', | 1209 'unlet g:var # something', |
1210 ], 'E488:') | 1210 ], 'E488:') |
1211 | |
1212 CheckScriptSuccess([ | |
1213 'vim9script', | |
1214 'if 1 # comment', | |
1215 ' echo "yes"', | |
1216 'elseif 2 #comment', | |
1217 ' echo "no"', | |
1218 'endif', | |
1219 ]) | |
1220 | |
1221 CheckScriptFailure([ | |
1222 'vim9script', | |
1223 'if 1# comment', | |
1224 ' echo "yes"', | |
1225 'endif', | |
1226 ], 'E15:') | |
1227 | |
1228 CheckScriptFailure([ | |
1229 'vim9script', | |
1230 'if 0 # comment', | |
1231 ' echo "yes"', | |
1232 'elseif 2#comment', | |
1233 ' echo "no"', | |
1234 'endif', | |
1235 ], 'E15:') | |
1236 | |
1237 CheckScriptSuccess([ | |
1238 'vim9script', | |
1239 'let # comment', | |
1240 ]) | |
1241 | |
1242 CheckScriptFailure([ | |
1243 'vim9script', | |
1244 'let# comment', | |
1245 ], 'E121:') | |
1246 | |
1247 CheckScriptSuccess([ | |
1248 'vim9script', | |
1249 'let v:version # comment', | |
1250 ]) | |
1251 | |
1252 CheckScriptFailure([ | |
1253 'vim9script', | |
1254 'let v:version# comment', | |
1255 ], 'E121:') | |
1256 | |
1257 CheckScriptSuccess([ | |
1258 'vim9script', | |
1259 'new' | |
1260 'call setline(1, ["# define pat", "last"])', | |
1261 '$', | |
1262 'dsearch /pat/ #comment', | |
1263 'bwipe!', | |
1264 ]) | |
1265 | |
1266 CheckScriptFailure([ | |
1267 'vim9script', | |
1268 'new' | |
1269 'call setline(1, ["# define pat", "last"])', | |
1270 '$', | |
1271 'dsearch /pat/#comment', | |
1272 'bwipe!', | |
1273 ], 'E488:') | |
1211 enddef | 1274 enddef |
1212 | 1275 |
1213 " Keep this last, it messes up highlighting. | 1276 " Keep this last, it messes up highlighting. |
1214 def Test_substitute_cmd() | 1277 def Test_substitute_cmd() |
1215 new | 1278 new |