diff src/testdir/test_vim9_func.vim @ 25046:2f702d19013a v8.2.3060

patch 8.2.3060: Vim9: cannot use ternary operator in parenthesis Commit: https://github.com/vim/vim/commit/98f9a5f4cbe6061e09bccf6074afe0a88a504219 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 26 22:22:38 2021 +0200 patch 8.2.3060: Vim9: cannot use ternary operator in parenthesis Problem: Vim9: cannot use ternary operator in parenthesis. Solution: Do not use "=~" for a default argument value. (closes https://github.com/vim/vim/issues/8462)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Jun 2021 22:30:05 +0200
parents 3f39b6b73019
children de29f9a76233
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -927,6 +927,9 @@ def Test_call_lambda_args()
       var a = 0
       var b = (a == 0 ? 1 : 2)
       assert_equal(1, b)
+      var txt = 'a'
+      b = (txt =~ 'x' ? 1 : 2)
+      assert_equal(2, b)
   END
   CheckDefAndScriptSuccess(lines)