0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1512: failure after trinary expression fails

Problem:    Failure after trinary expression fails.
Solution:   Restore eval_flags. (Yasuhiro Matsumoto, closes #6776)
This commit is contained in:
Bram Moolenaar
2020-08-22 22:37:20 +02:00
parent cd94277f72
commit 69e44552c5
4 changed files with 54 additions and 0 deletions

View File

@@ -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