From 7b8fcf0234441a7db29897d60c728ad2adb83464 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: [PATCH] vim-patch:7.4.1163 Problem: Expressions "0 + v:true" and "'' . v:true" cause an error. Solution: Return something sensible when using a special variable as a number or as a string. (suggested by Damien) https://github.com/vim/vim/commit/17a13437c9414a8693369a97f3be2fc8ad48c12e Code is N/A. This only ports the tests. Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index c59cab5f36..c3e882ad05 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1156,6 +1156,16 @@ func Test_type() call assert_equal(v:t_list, type(v:_null_list)) call assert_equal(v:t_dict, type(v:_null_dict)) call assert_equal(v:t_blob, type(v:_null_blob)) + + call assert_equal(0, 0 + v:false) + call assert_equal(1, 0 + v:true) + " call assert_equal(0, 0 + v:none) + call assert_equal(0, 0 + v:null) + + call assert_equal('false', '' . v:false) + call assert_equal('true', '' . v:true) + " call assert_equal('none', '' . v:none) + call assert_equal('null', '' . v:null) endfunc "-------------------------------------------------------------------------------