Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 21959:67d4be2757b0 v8.2.1529
patch 8.2.1529: Vim9: :elseif may be compiled when not needed
Commit: https://github.com/vim/vim/commit/749639ec7248740cd271f34ec5f7bb70891b459c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 27 23:08:47 2020 +0200
patch 8.2.1529: Vim9: :elseif may be compiled when not needed
Problem: Vim9: :elseif may be compiled when not needed.
Solution: Do evaluate the :elseif expression.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 27 Aug 2020 23:15:04 +0200 |
parents | 3991a6df522e |
children | 11dbf7e1f65c |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -43,6 +43,9 @@ def Test_expr1() var = 0 assert_equal('two', var ? 'one' : 'two') + # with constant condition expression is not evaluated + assert_equal('one', 1 ? 'one' : xxx) + let Some: func = function('len') let Other: func = function('winnr') let Res: func = g:atrue ? Some : Other @@ -139,7 +142,6 @@ enddef func Test_expr1_fails() call CheckDefFailure(["let x = 1 ? 'one'"], "Missing ':' after '?'", 1) - call CheckDefFailure(["let x = 1 ? 'one' : xxx"], "E1001:", 1) let msg = "white space required before and after '?'" call CheckDefFailure(["let x = 1? 'one' : 'two'"], msg, 1)