diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-19 17:17:02 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-19 17:17:02 +0200 |
commit | b209750b5e907003568c20856215122670ee22d2 (patch) | |
tree | 8aad47e083a1a915a32d2aad9afcc2d71c19cde2 /src/testdir/test_vim9_script.vim | |
parent | f398238a37522fed9a2e7915741d1ab14ccc81a0 (diff) | |
download | vim-git-b209750b5e907003568c20856215122670ee22d2.tar.gz |
patch 8.2.1246: Vim9: comment after assignment doesn't workv8.2.1246
Problem: Vim9: comment after assignment doesn't work.
Solution: Skip over white space. (closes #6481)
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 035c731cc..fa5ee3c12 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -29,7 +29,7 @@ def Test_assignment() call CheckDefFailure(['let x:string = "x"'], 'E1069:') call CheckDefFailure(['let a:string = "x"'], 'E1069:') - let a: number = 6 + let a: number = 6 #comment assert_equal(6, a) if has('channel') @@ -44,7 +44,7 @@ def Test_assignment() let Funky2: func = function('len') let Party2: func = funcref('g:Test_syntax') - g:newvar = 'new' + g:newvar = 'new' #comment assert_equal('new', g:newvar) assert_equal('yes', g:existing) @@ -821,6 +821,22 @@ def Test_cexpr_vimscript() set errorformat& enddef +def Test_list_vimscript() + # checks line continuation and comments + let lines =<< trim END + vim9script + let mylist = [ + 'one', + # comment + 'two', # empty line follows + + 'three', + ] + assert_equal(['one', 'two', 'three'], mylist) + END + CheckScriptSuccess(lines) +enddef + if has('channel') let someJob = test_null_job() |