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:
@@ -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
|
||||
|
Reference in New Issue
Block a user