diff src/testdir/test_vimscript.vim @ 21925:51d591dbb8df v8.2.1512

patch 8.2.1512: failure after trinary expression fails Commit: https://github.com/vim/vim/commit/69e44552c567ff25b363ba0790ad3d43fa0397a7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 22 22:37:20 2020 +0200 patch 8.2.1512: failure after trinary expression fails Problem: Failure after trinary expression fails. Solution: Restore eval_flags. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/6776)
author Bram Moolenaar <Bram@vim.org>
date Sat, 22 Aug 2020 22:45:03 +0200
parents 99fe9e960207
children ff21e2962490
line wrap: on
line diff
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -7445,6 +7445,30 @@ func Test_typed_script_var()
   call StopVimInTerminal(buf)
 endfunc
 
+" Test for issue6776              {{{1
+func Test_trinary_expression()
+  try
+    call eval('0 ? 0')
+  catch
+  endtry
+  " previous failure should not cause next expression to fail
+  call assert_equal(v:false, eval(string(v:false)))
+
+  try
+    call eval('0 ? "burp')
+  catch
+  endtry
+  " previous failure should not cause next expression to fail
+  call assert_equal(v:false, eval(string(v:false)))
+
+  try
+    call eval('1 ? 0 : "burp')
+  catch
+  endtry
+  " previous failure should not cause next expression to fail
+  call assert_equal(v:false, eval(string(v:false)))
+endfunction
+
 "-------------------------------------------------------------------------------
 " Modelines								    {{{1
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker