patch 8.2.0615: regexp benchmark stest is old style
Problem: Regexp benchmark stest is old style.
Solution: Make it a new style test. Fix using a NULL list. Add more tests.
(Yegappan Lakshmanan, closes #5963)
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index f7a438a..dbd0804 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -794,18 +794,41 @@
set complete&
endfunc
+" Test for append()
func Test_append()
enew!
split
call append(0, ["foo"])
+ call append(1, [])
+ call append(1, test_null_list())
+ call assert_equal(['foo', ''], getline(1, '$'))
split
only
undo
+ undo
" Using $ instead of '$' must give an error
call assert_fails("call append($, 'foobar')", 'E116:')
endfunc
+" Test for setline()
+func Test_setline()
+ new
+ call setline(0, ["foo"])
+ call setline(0, [])
+ call setline(0, test_null_list())
+ call setline(1, ["bar"])
+ call setline(1, [])
+ call setline(1, test_null_list())
+ call setline(2, [])
+ call setline(2, test_null_list())
+ call setline(3, [])
+ call setline(3, test_null_list())
+ call setline(2, ["baz"])
+ call assert_equal(['bar', 'baz'], getline(1, '$'))
+ close!
+endfunc
+
func Test_getbufvar()
let bnr = bufnr('%')
let b:var_num = '1234'
@@ -913,6 +936,7 @@
call assert_equal(-1, match(['a', 'b', 'c', 'a'], 'a', 5))
call assert_equal(4, match('testing', 'ing', -1))
call assert_fails("let x=match('testing', 'ing', 0, [])", 'E745:')
+ call assert_equal(-1, match(test_null_list(), 2))
endfunc
func Test_matchend()
@@ -1796,6 +1820,7 @@
call assert_equal(3, 'len'->call([123]))
call assert_fails("call call('len', 123)", 'E714:')
call assert_equal(0, call('', []))
+ call assert_equal(0, call('len', test_null_list()))
function Mylen() dict
return len(self.data)
@@ -1962,7 +1987,6 @@
execute "normal! a\<C-r>=[complete(col('.'), range(10)), ''][1]\<CR>"
" complete_info()
execute "normal! a\<C-r>=[complete(col('.'), range(10)), ''][1]\<CR>\<C-r>=[complete_info(range(5)), ''][1]\<CR>"
- call assert_fails('call complete(1, ["a"])', 'E785:')
" copy()
call assert_equal([1, 2, 3], copy(range(1, 3)))