aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-15 13:31:30 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-15 13:48:30 +0800
commit85741677c86f7686e3597a310f8059608e7816fb (patch)
tree2d203ebcd6609c1db6c61cde4d43fccb7424f341 /test/old/testdir/test_functions.vim
parent4b49f312a05214d5d1974f7ac2702ffb407fc558 (diff)
downloadrneovim-85741677c86f7686e3597a310f8059608e7816fb.tar.gz
rneovim-85741677c86f7686e3597a310f8059608e7816fb.tar.bz2
rneovim-85741677c86f7686e3597a310f8059608e7816fb.zip
vim-patch:8.2.0634: crash with null partial and blob
Problem: Crash with null partial and blob. Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5984) https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/old/testdir/test_functions.vim')
-rw-r--r--test/old/testdir/test_functions.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 4ed1187a19..94c7e20264 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -990,6 +990,7 @@ func Test_matchstrpos()
call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 8))
call assert_equal(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing'))
call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img'))
+ call assert_equal(['', -1, -1], matchstrpos(v:_null_list, '\a'))
endfunc
func Test_nextnonblank_prevnonblank()
@@ -1284,6 +1285,7 @@ func Test_hlexists()
syntax off
endfunc
+" Test for the col() function
func Test_col()
new
call setline(1, 'abcdef')
@@ -1435,6 +1437,8 @@ func Test_inputlist()
call assert_equal(-2, c)
call assert_fails('call inputlist("")', 'E686:')
+ " Nvim accepts null list as empty list
+ " call assert_fails('call inputlist(v:_null_list)', 'E686:')
endfunc
func Test_range_inputlist()
@@ -2357,6 +2361,16 @@ func Test_garbagecollect_now_fails()
let v:testing = 1
endfunc
+" Test for echo highlighting
+func Test_echohl()
+ echohl Search
+ echo 'Vim'
+ call assert_equal('Vim', Screenline(&lines))
+ " TODO: How to check the highlight group used by echohl?
+ " ScreenAttrs() returns all zeros.
+ echohl None
+endfunc
+
" Test for the eval() function
func Test_eval()
call assert_fails("call eval('5 a')", 'E488:')
@@ -2515,6 +2529,18 @@ func Test_glob()
call assert_fails("call glob('*', 0, {})", 'E728:')
endfunc
+" Test for browse()
+func Test_browse()
+ CheckFeature browse
+ call assert_fails('call browse([], "open", "x", "a.c")', 'E745:')
+endfunc
+
+" Test for browsedir()
+func Test_browsedir()
+ CheckFeature browse
+ call assert_fails('call browsedir("open", [])', 'E730:')
+endfunc
+
func HasDefault(msg = 'msg')
return a:msg
endfunc