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

@@ -114,6 +114,27 @@ def Test_expr1_vimscript()
let var = v:true ? 1 :2
END
CheckScriptFailure(lines, 'E1004:', 2)
# check after failure eval_flags is reset
lines =<< trim END
vim9script
try
call eval('0 ? 1: 2')
catch
endtry
assert_equal(v:true, eval(string(v:true)))
END
CheckScriptSuccess(lines)
lines =<< trim END
vim9script
try
call eval('0 ? 1 :2')
catch
endtry
assert_equal(v:true, eval(string(v:true)))
END
CheckScriptSuccess(lines)
enddef
func Test_expr1_fails()