aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-14 17:06:52 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-14 17:21:22 +0800
commitaaacfd4a6d8f43367f7fb3ba8d81baad3fde6c8e (patch)
tree7135c369ce05088ce7ed7e125491b6602d9907a0 /test
parent85a7f9dabe0bcd6a1b3a0941f0bc0d1983b01888 (diff)
downloadrneovim-aaacfd4a6d8f43367f7fb3ba8d81baad3fde6c8e.tar.gz
rneovim-aaacfd4a6d8f43367f7fb3ba8d81baad3fde6c8e.tar.bz2
rneovim-aaacfd4a6d8f43367f7fb3ba8d81baad3fde6c8e.zip
vim-patch:8.2.1512: failure after trinary expression fails
Problem: Failure after trinary expression fails. Solution: Restore eval_flags. (Yasuhiro Matsumoto, closes vim/vim#6776) https://github.com/vim/vim/commit/69e44552c567ff25b363ba0790ad3d43fa0397a7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_vimscript.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/old/testdir/test_vimscript.vim b/test/old/testdir/test_vimscript.vim
index b0c4baf7c2..6ac19a357f 100644
--- a/test/old/testdir/test_vimscript.vim
+++ b/test/old/testdir/test_vimscript.vim
@@ -7258,6 +7258,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
+
func Test_for_over_string()
let res = ''
for c in 'aéc̀d'