diff src/testdir/test_functions.vim @ 20109:e82996ad131f v8.2.0610

patch 8.2.0610: some tests are still old style Commit: https://github.com/vim/vim/commit/08f4157c5cabc55bcb22f04dd7c717aba40caa34 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 20 16:50:00 2020 +0200 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 https://github.com/vim/vim/issues/5957)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Apr 2020 17:00:04 +0200
parents c087099e9163
children 16460964c304
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -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