comparison src/testdir/test_vim9_script.vim @ 20116:513c62184ed8 v8.2.0613

patch 8.2.0613: Vim9: no check for space before #comment Commit: https://github.com/vim/vim/commit/1966c248814d5195edcd1208ed0e51e664a61283 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 20 22:42:32 2020 +0200 patch 8.2.0613: 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 22:45:04 +0200
parents 2c23053c654a
children d0a9766167ab
comparison
equal deleted inserted replaced
20115:bd021eb62e73 20116:513c62184ed8
1208 ]) 1208 ])
1209 CheckScriptFailure([ 1209 CheckScriptFailure([
1210 'vim9script', 1210 'vim9script',
1211 'hi# comment', 1211 'hi# comment',
1212 ], 'E416:') 1212 ], 'E416:')
1213 CheckScriptSuccess([
1214 'vim9script',
1215 'hi Search # comment',
1216 ])
1217 CheckScriptFailure([
1218 'vim9script',
1219 'hi Search# comment',
1220 ], 'E416:')
1221 CheckScriptSuccess([
1222 'vim9script',
1223 'hi link This Search # comment',
1224 ])
1225 CheckScriptFailure([
1226 'vim9script',
1227 'hi link This That# comment',
1228 ], 'E413:')
1229 CheckScriptSuccess([
1230 'vim9script',
1231 'hi clear This # comment',
1232 'hi clear # comment',
1233 ])
1234 " not tested, because it doesn't give an error but a warning:
1235 " hi clear This# comment',
1236 CheckScriptFailure([
1237 'vim9script',
1238 'hi clear# comment',
1239 ], 'E416:')
1240
1241 CheckScriptSuccess([
1242 'vim9script',
1243 'hi Group term=bold',
1244 'match Group /todo/ # comment',
1245 ])
1246 CheckScriptFailure([
1247 'vim9script',
1248 'hi Group term=bold',
1249 'match Group /todo/# comment',
1250 ], 'E488:')
1251 CheckScriptSuccess([
1252 'vim9script',
1253 'match # comment',
1254 ])
1255 CheckScriptFailure([
1256 'vim9script',
1257 'match# comment',
1258 ], 'E475:')
1259 CheckScriptSuccess([
1260 'vim9script',
1261 'match none # comment',
1262 ])
1263 CheckScriptFailure([
1264 'vim9script',
1265 'match none# comment',
1266 ], 'E475:')
1267
1268 CheckScriptSuccess([
1269 'vim9script',
1270 'menutrans clear # comment',
1271 ])
1272 CheckScriptFailure([
1273 'vim9script',
1274 'menutrans clear# comment text',
1275 ], 'E474:')
1276
1277 CheckScriptSuccess([
1278 'vim9script',
1279 'syntax clear # comment',
1280 ])
1281 CheckScriptFailure([
1282 'vim9script',
1283 'syntax clear# comment text',
1284 ], 'E28:')
1285 CheckScriptSuccess([
1286 'vim9script',
1287 'syntax keyword Word some',
1288 'syntax clear Word # comment',
1289 ])
1290 CheckScriptFailure([
1291 'vim9script',
1292 'syntax keyword Word some',
1293 'syntax clear Word# comment text',
1294 ], 'E28:')
1295
1296 CheckScriptSuccess([
1297 'vim9script',
1298 'syntax list # comment',
1299 ])
1300 CheckScriptFailure([
1301 'vim9script',
1302 'syntax list# comment text',
1303 ], 'E28:')
1304
1305 CheckScriptSuccess([
1306 'vim9script',
1307 'syntax match Word /pat/ oneline # comment',
1308 ])
1309 CheckScriptFailure([
1310 'vim9script',
1311 'syntax match Word /pat/ oneline# comment',
1312 ], 'E475:')
1313
1314 CheckScriptSuccess([
1315 'vim9script',
1316 'syntax keyword Word word # comm[ent',
1317 ])
1318 CheckScriptFailure([
1319 'vim9script',
1320 'syntax keyword Word word# comm[ent',
1321 ], 'E789:')
1322
1323 CheckScriptSuccess([
1324 'vim9script',
1325 'syntax match Word /pat/ # comment',
1326 ])
1327 CheckScriptFailure([
1328 'vim9script',
1329 'syntax match Word /pat/# comment',
1330 ], 'E402:')
1331
1332 CheckScriptSuccess([
1333 'vim9script',
1334 'syntax match Word /pat/ contains=Something # comment',
1335 ])
1336 CheckScriptFailure([
1337 'vim9script',
1338 'syntax match Word /pat/ contains=Something# comment',
1339 ], 'E475:')
1340 CheckScriptFailure([
1341 'vim9script',
1342 'syntax match Word /pat/ contains= # comment',
1343 ], 'E406:')
1344 CheckScriptFailure([
1345 'vim9script',
1346 'syntax match Word /pat/ contains=# comment',
1347 ], 'E475:')
1348
1349 CheckScriptSuccess([
1350 'vim9script',
1351 'syntax region Word start=/pat/ end=/pat/ # comment',
1352 ])
1353 CheckScriptFailure([
1354 'vim9script',
1355 'syntax region Word start=/pat/ end=/pat/# comment',
1356 ], 'E475:')
1357
1358 CheckScriptSuccess([
1359 'vim9script',
1360 'syntax sync # comment',
1361 ])
1362 CheckScriptFailure([
1363 'vim9script',
1364 'syntax sync# comment',
1365 ], 'E404:')
1366 CheckScriptSuccess([
1367 'vim9script',
1368 'syntax sync ccomment # comment',
1369 ])
1370 CheckScriptFailure([
1371 'vim9script',
1372 'syntax sync ccomment# comment',
1373 ], 'E404:')
1374
1375 CheckScriptSuccess([
1376 'vim9script',
1377 'syntax cluster Some contains=Word # comment',
1378 ])
1379 CheckScriptFailure([
1380 'vim9script',
1381 'syntax cluster Some contains=Word# comment',
1382 ], 'E475:')
1213 enddef 1383 enddef
1214 1384
1215 def Test_vim9_comment_gui() 1385 def Test_vim9_comment_gui()
1216 CheckCanRunGui 1386 CheckCanRunGui
1217 1387