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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user