1
0
forked from aniani/vim

patch 8.2.0418: code in eval.c not sufficiently covered by tests

Problem:    Code in eval.c not sufficiently covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #5815)
This commit is contained in:
Bram Moolenaar
2020-03-20 18:20:51 +01:00
parent 98be7fecac
commit 8b63313510
18 changed files with 228 additions and 53 deletions

View File

@@ -1145,6 +1145,7 @@ func Test_col()
norm gg4|mx6|mY2|
call assert_equal(2, col('.'))
call assert_equal(7, col('$'))
call assert_equal(2, col('v'))
call assert_equal(4, col("'x"))
call assert_equal(6, col("'Y"))
call assert_equal(2, [1, 2]->col())
@@ -1155,6 +1156,19 @@ func Test_col()
call assert_equal(0, col([2, '$']))
call assert_equal(0, col([1, 100]))
call assert_equal(0, col([1]))
" test for getting the visual start column
func T()
let g:Vcol = col('v')
return ''
endfunc
let g:Vcol = 0
xmap <expr> <F2> T()
exe "normal gg3|ve\<F2>"
call assert_equal(3, g:Vcol)
xunmap <F2>
delfunc T
bw!
endfunc