Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 20982:bb49b5090a9c v8.2.1042
patch 8.2.1042: Vim9: cannot put an operator on the next line
Commit: https://github.com/vim/vim/commit/df069eec3b90401e880e9b0e258146d8f36c474d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 22 23:02:51 2020 +0200
patch 8.2.1042: Vim9: cannot put an operator on the next line
Problem: Vim9: cannot put an operator on the next line.
Solution: Require a colon before a range to see if that causes problems.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 22 Jun 2020 23:15:04 +0200 |
parents | 6b4b887a12f0 |
children | 376b520312d6 |
comparison
equal
deleted
inserted
replaced
20981:6e0166b4443d | 20982:bb49b5090a9c |
---|---|
466 call CheckDefFailure(['const one = 234', 'let one = 99'], 'E1017:') | 466 call CheckDefFailure(['const one = 234', 'let one = 99'], 'E1017:') |
467 call CheckDefFailure(['const two'], 'E1021:') | 467 call CheckDefFailure(['const two'], 'E1021:') |
468 call CheckDefFailure(['const &option'], 'E996:') | 468 call CheckDefFailure(['const &option'], 'E996:') |
469 endfunc | 469 endfunc |
470 | 470 |
471 def Test_range_no_colon() | |
472 call CheckDefFailure(['%s/a/b/'], 'E1050:') | |
473 call CheckDefFailure(['+ s/a/b/'], 'E1050:') | |
474 call CheckDefFailure(['- s/a/b/'], 'E1050:') | |
475 call CheckDefFailure(['. s/a/b/'], 'E1050:') | |
476 enddef | |
477 | |
478 | |
471 def Test_block() | 479 def Test_block() |
472 let outer = 1 | 480 let outer = 1 |
473 { | 481 { |
474 let inner = 2 | 482 let inner = 2 |
475 assert_equal(1, outer) | 483 assert_equal(1, outer) |
1277 | 1285 |
1278 def Test_echomsg_cmd() | 1286 def Test_echomsg_cmd() |
1279 echomsg 'some' 'more' # comment | 1287 echomsg 'some' 'more' # comment |
1280 assert_match('^some more$', Screenline(&lines)) | 1288 assert_match('^some more$', Screenline(&lines)) |
1281 echo 'clear' | 1289 echo 'clear' |
1282 1messages | 1290 :1messages |
1283 assert_match('^some more$', Screenline(&lines)) | 1291 assert_match('^some more$', Screenline(&lines)) |
1284 | 1292 |
1285 call CheckDefFailure(['echomsg "xxx"# comment'], 'E488:') | 1293 call CheckDefFailure(['echomsg "xxx"# comment'], 'E488:') |
1286 enddef | 1294 enddef |
1287 | 1295 |
1896 | 1904 |
1897 CheckScriptSuccess([ | 1905 CheckScriptSuccess([ |
1898 'vim9script', | 1906 'vim9script', |
1899 'new' | 1907 'new' |
1900 'call setline(1, ["# define pat", "last"])', | 1908 'call setline(1, ["# define pat", "last"])', |
1901 '$', | 1909 ':$', |
1902 'dsearch /pat/ #comment', | 1910 'dsearch /pat/ #comment', |
1903 'bwipe!', | 1911 'bwipe!', |
1904 ]) | 1912 ]) |
1905 | 1913 |
1906 CheckScriptFailure([ | 1914 CheckScriptFailure([ |
1907 'vim9script', | 1915 'vim9script', |
1908 'new' | 1916 'new' |
1909 'call setline(1, ["# define pat", "last"])', | 1917 'call setline(1, ["# define pat", "last"])', |
1910 '$', | 1918 ':$', |
1911 'dsearch /pat/#comment', | 1919 'dsearch /pat/#comment', |
1912 'bwipe!', | 1920 'bwipe!', |
1913 ], 'E488:') | 1921 ], 'E488:') |
1914 | 1922 |
1915 CheckScriptFailure([ | 1923 CheckScriptFailure([ |