aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-07 05:34:20 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-07 05:34:20 +0800
commit7b8fcf0234441a7db29897d60c728ad2adb83464 (patch)
tree28a6c4068464099f588717464246525bfd1b7d4c
parente2466d84bc818c8e61751972b501551aab07d13c (diff)
downloadrneovim-7b8fcf0234441a7db29897d60c728ad2adb83464.tar.gz
rneovim-7b8fcf0234441a7db29897d60c728ad2adb83464.tar.bz2
rneovim-7b8fcf0234441a7db29897d60c728ad2adb83464.zip
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.
-rw-r--r--src/nvim/testdir/test_vimscript.vim10
1 files changed, 10 insertions, 0 deletions
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
"-------------------------------------------------------------------------------