0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.0610: some tests are still old style

Problem:    Some tests are still old style.
Solution:   Convert to new style tests. (Yegappan Lakshmanan, closes #5957)
This commit is contained in:
Bram Moolenaar
2020-04-20 16:50:00 +02:00
parent ad4dc83389
commit 08f4157c5c
15 changed files with 178 additions and 106 deletions

View File

@@ -99,9 +99,11 @@ func Test_len()
call assert_equal(2, len('ab'))
call assert_equal(0, len([]))
call assert_equal(0, len(test_null_list()))
call assert_equal(2, len([2, 1]))
call assert_equal(0, len({}))
call assert_equal(0, len(test_null_dict()))
call assert_equal(2, len({'a': 1, 'b': 2}))
call assert_fails('call len(v:none)', 'E701:')
@@ -799,6 +801,9 @@ func Test_append()
split
only
undo
" Using $ instead of '$' must give an error
call assert_fails("call append($, 'foobar')", 'E116:')
endfunc
func Test_getbufvar()
@@ -2043,6 +2048,7 @@ func Test_range()
" list2str()
call assert_equal('ABC', list2str(range(65, 67)))
call assert_fails('let s = list2str(5)', 'E474:')
" lock()
let thelist = range(5)
@@ -2216,4 +2222,17 @@ func Test_screen_functions()
call assert_equal([], screenchars(-1, -1))
endfunc
" Test for getcurpos() and setpos()
func Test_getcurpos_setpos()
new
call setline(1, ['012345678', '012345678'])
normal gg6l
let sp = getcurpos()
normal 0
call setpos('.', sp)
normal jyl
call assert_equal('6', @")
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab