diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-13 08:09:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-13 08:09:21 +0800 |
| commit | f516a9ced7238dbb9a3eff453736702fc3d9ec82 (patch) | |
| tree | 8da04d6c08300f6b09d944378cd15814af61d533 /src/nvim/testdir/test_vimscript.vim | |
| parent | 47ad4c8701b4233aa302c1c21ff08a5f223596c7 (diff) | |
| parent | b25197258086faa94ddfaa2a74e1d0eb3695d9b3 (diff) | |
| download | rneovim-f516a9ced7238dbb9a3eff453736702fc3d9ec82.tar.gz rneovim-f516a9ced7238dbb9a3eff453736702fc3d9ec82.tar.bz2 rneovim-f516a9ced7238dbb9a3eff453736702fc3d9ec82.zip | |
Merge pull request #21037 from zeertzjq/vim-8.2.4675
vim-patch:8.2.{4675,4676},9.0.0869: no error for missing expression after :elseif
Diffstat (limited to 'src/nvim/testdir/test_vimscript.vim')
| -rw-r--r-- | src/nvim/testdir/test_vimscript.vim | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 44904af160..c93ba9dcfc 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -193,6 +193,16 @@ func Test_if_while() call assert_equal('ab3j3b2c2b1f1h1km', g:Xpath) endfunc +" Check double quote after skipped "elseif" does not give error E15 +func Test_skipped_elseif() + if "foo" ==? "foo" + let result = "first" + elseif "foo" ==? "foo" + let result = "second" + endif + call assert_equal('first', result) +endfunc + "------------------------------------------------------------------------------- " Test 4: :return {{{1 "------------------------------------------------------------------------------- @@ -3024,7 +3034,7 @@ func Test_nested_if_else_errors() " :elseif without :if let code =<< trim END - elseif + elseif 1 END call writefile(code, 'Xtest') call AssertException(['source Xtest'], 'Vim(elseif):E582: :elseif without :if') @@ -3032,7 +3042,7 @@ func Test_nested_if_else_errors() " :elseif without :if let code =<< trim END while 1 - elseif + elseif 1 endwhile END call writefile(code, 'Xtest') @@ -3042,7 +3052,7 @@ func Test_nested_if_else_errors() let code =<< trim END try finally - elseif + elseif 1 endtry END call writefile(code, 'Xtest') @@ -3051,7 +3061,7 @@ func Test_nested_if_else_errors() " :elseif without :if let code =<< trim END try - elseif + elseif 1 endtry END call writefile(code, 'Xtest') @@ -3062,7 +3072,7 @@ func Test_nested_if_else_errors() try throw "a" catch /a/ - elseif + elseif 1 endtry END call writefile(code, 'Xtest') |